Skip to content

Commit

Permalink
migrate the move repository into the third_party directory
Browse files Browse the repository at this point in the history
remove unused files

update the evm crate to 0.41.1

remove the Cargo.lock file in third_party directory

update the evm crate to 0.41.1

update the evm crate to 0.41.1

remove unused dep

add the missed files

cargo fmt

fix cargo clippy

remove the test file

remove test file

remove test file
  • Loading branch information
steelgeek091 committed Nov 27, 2024
1 parent b70ff13 commit 3194977
Show file tree
Hide file tree
Showing 5,553 changed files with 496,676 additions and 146 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
962 changes: 851 additions & 111 deletions Cargo.lock

Large diffs are not rendered by default.

64 changes: 31 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ members = [
"frameworks/moveos-stdlib",
"frameworks/rooch-framework",
"frameworks/rooch-nursery", "crates/bitcoin-client",
"third_party/move/language/move-compiler-v2"
]

default-members = [
Expand Down Expand Up @@ -360,39 +361,36 @@ handlebars = "4.2.2"

# Note: the BEGIN and END comments below are required for external tooling. Do not remove.
# BEGIN MOVE DEPENDENCIES
move-abigen = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-binary-format = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-bytecode-verifier = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-bytecode-utils = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-cli = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-command-line-common = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-compiler = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-core-types = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-coverage = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-disassembler = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-docgen = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-errmapgen = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-ir-compiler = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-model = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-package = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-prover = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-prover-boogie-backend = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-stackless-bytecode = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-prover-test-utils = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-resource-viewer = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-stackless-bytecode-interpreter = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-stdlib = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24", features = ["testing"] }
move-symbol-pool = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
#move-table-extension = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-transactional-test-runner = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-unit-test = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24", features = ["table-extension"] }
move-vm-runtime = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24", features = ["stacktrace", "debugging", "testing"] }
move-vm-test-utils = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24", features = ["table-extension"] }
move-vm-types = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
read-write-set = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
read-write-set-dynamic = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-bytecode-source-map = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }
move-ir-types = { git = "https://github.com/rooch-network/move", rev = "e8783853c750d952d277efed937049c0c5a7bb24" }# END MOVE DEPENDENCIES
move-abigen = { path = "third_party/move/language/move-prover/move-abigen" }
move-binary-format = { path = "third_party/move/language/move-binary-format" }
move-bytecode-verifier = { path = "third_party/move/language/move-bytecode-verifier" }
move-bytecode-utils = { path = "third_party/move/language/tools/move-bytecode-utils" }
move-cli = { path = "third_party/move/language/tools/move-cli" }
move-command-line-common = { path = "third_party/move/language/move-command-line-common" }
move-compiler = { path = "third_party/move/language/move-compiler" }
move-core-types = { path = "third_party/move/language/move-core/types" }
move-coverage = { path = "third_party/move/language/tools/move-coverage" }
move-disassembler = { path = "third_party/move/language/tools/move-disassembler" }
move-docgen = { path = "third_party/move/language/move-prover/move-docgen" }
move-errmapgen = { path = "third_party/move/language/move-prover/move-errmapgen" }
move-ir-compiler = { path = "third_party/move/language/move-ir-compiler" }
move-model = { path = "third_party/move/language/move-model" }
move-package = { path = "third_party/move/language/tools/move-package" }
move-prover = { path = "third_party/move/language/move-prover" }
move-prover-boogie-backend = { path = "third_party/move/language/move-prover/boogie-backend" }
move-stackless-bytecode = { path = "third_party/move/language/move-prover/bytecode" }
move-prover-test-utils = { path = "third_party/move/language/move-prover/test-utils" }
move-resource-viewer = { path = "third_party/move/language/tools/move-resource-viewer" }
move-stdlib = { path = "third_party/move/language/move-stdlib", features = ["testing"] }
move-symbol-pool = { path = "third_party/move/language/move-symbol-pool" }
move-transactional-test-runner = { path = "third_party/move/language/testing-infra/transactional-test-runner" }
move-unit-test = { path = "third_party/move/language/tools/move-unit-test", features = ["table-extension"] }
move-vm-runtime = { path = "third_party/move/language/move-vm/runtime", features = ["stacktrace", "debugging", "testing"] }
move-vm-test-utils = { path = "third_party/move/language/move-vm/test-utils", features = ["table-extension"] }
move-vm-types = { path = "third_party/move/language/move-vm/types" }
move-bytecode-source-map = { path = "third_party/move/language/move-ir-compiler/move-bytecode-source-map" }
move-ir-types = { path = "third_party/move/language/move-ir/types" }# END MOVE DEPENDENCIES

# keep this for convenient debug Move in local repo
# [patch.'https://github.com/rooch-network/move']
# move-abigen = { path = "../move/language/move-prover/move-abigen" }
Expand Down
2 changes: 0 additions & 2 deletions rustfmt.toml

This file was deleted.

3 changes: 3 additions & 0 deletions third_party/move/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

The Diem Core project has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://developers.diem.com/docs/policies/code-of-conduct) so that you can understand what actions will and will not be tolerated.
160 changes: 160 additions & 0 deletions third_party/move/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
id: contributing
title: Contributing to Move
---

To contribute to the Move implementation, first start with the proper
development copy.

To get the development installation with all the necessary dependencies for
linting, testing, and building the documentation, run the following:
```bash
git clone https://github.com/move-language/move.git
cd move
./scripts/dev_setup.sh # with optional [-t -b -p -y -d -n -v], see the script for more details
cargo build
cargo xtest
```


## Developer Workflow

Changes to the project are proposed through pull requests. The general pull
request workflow is as follows:

1. Fork the repo and create a topic branch off of `main`.
2. If you have added code that should be tested, add unit tests.
3. If you have changed APIs, update the documentation. Make sure the
documentation builds.
4. Ensure all tests and lints pass on each and every commit that is part of
your pull request. `cargo x lint && cargo xfmt && cargo xclippy --all-targets`
5. Submit your pull request.

## Authoring Clean Commits

#### Logically Separate Commits

Commits should be
[atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention)
and broken down into logically separate changes. Diffs should also be made easy
for reviewers to read and review so formatting fixes or code moves should not
be included in commits with actual code changes.

#### Meaningful Commit Messages

Commit messages are important and incredibly helpful for others when they dig
through the commit history in order to understand why a particular change
was made and what problem it was intending to solve. For this reason commit
messages should be well written and conform with the following format:

All commit messages should begin with a single short (50 character max) line
summarizing the change and should skip the full stop. This is the title of the
commit. It is also preferred that this summary be prefixed with "[area]" where
the area is an identifier for the general area of the code being modified, e.g.

```
* [ci] enforce whitelist of nightly features
* [language] removing VerificationPass trait
```

Following the commit title (unless it alone is self-explanatory), there should
be a single blank line followed by the commit body which includes more
detailed, explanatory text as separate paragraph(s). It is recommended that the
commit body be wrapped at 72 characters so that Git has plenty of room to
indent the text while still keeping everything under 80 characters overall.

The commit body should provide a meaningful commit message, which:
* Explains the problem the change tries to solve, i.e. what is wrong
with the current code without the change.
* Justifies the way the change solves the problem, i.e. why the
result with the change is better.
* Alternative solutions considered but discarded, if any.

#### References in Commit Messages

If you want to reference a previous commit in the history of the project, use
the format "abbreviated sha1 (subject, date)", with the subject enclosed in a
pair of double-quotes, like this:

```bash
Commit 895b53510 ("[vm] use slices instead of evecotrs", 2021-08-19)
noticed that ...
```

This invocation of `git show` can be used to obtain this format:

```bash
git show -s --date=short --pretty='format:%h ("%s", %ad)' <commit>
```

If a commit references an issue please add a reference to the body of your
commit message, e.g. `issue #1234` or `fixes #456`. Using keywords like
`fixes`, `resolves`, or `closes` will cause the corresponding issue to be
closed when the pull request is merged.

Avoid adding any `@` mentions to commit messages, instead add them to the PR
cover letter.

## Responding to Reviewer Feedback

During the review process a reviewer may ask you to make changes to your pull
request. If a particular commit needs to be changed, that commit should be
amended directly. Changes in response to a review *should not* be made in
separate commits on top of your PR unless it logically makes sense to have
separate, distinct commits for those changes. This helps keep the commit
history clean.

If your pull request is out-of-date and needs to be updated because `main`
has advanced, you should rebase your branch on top of the latest main by
doing the following:

```bash
git fetch upstream
git checkout topic
git rebase -i upstream/main
```

You *should not* update your branch by merging the latest main into your
branch. Merge commits included in PRs tend to make it more difficult for the
reviewer to understand the change being made, especially if the merge wasn't
clean and needed conflicts to be resolved. As such, PRs with merge commits will
be rejected.

## Bisect-able History

It is important that the project history is bisect-able so that when
regressions are identified we can easily use `git bisect` to be able to
pin-point the exact commit which introduced the regression. This requires that
every commit is able to be built and passes all lints and tests. So if your
pull request includes multiple commits be sure that each and every commit is
able to be built and passes all checks performed by CI.


## Issues

Move uses [GitHub issues](https://github.com/move-language/move/issues) to track
bugs. Please include necessary information and instructions to reproduce your
issue.

## Major feature requests

Please begin by checking the following locations for duplicate requests:
* [Approved feature proposals awaiting implementation](https://github.com/move-language/move/issues?q=is%3Aissue+is%3Aopen+label%3A%22accepted+feature+awaiting+implementation%22)
* [Feature proposals under discussion](https://github.com/move-language/move/issues?q=is%3Aissue+is%3Aopen+label%3A%22proposed+feature+in+discussion%22)
* [Language feature request graveyard](GRAVEYARD.md)

If your feature is not in any of these locations, please add a new feature request using the following format:

```
Sponsor: your_github_id
## Status: initial proposal
## Rationale
A detailed description of the problem the proposed feature seeks to solve. This should explain why the problem is important for smart contract programmers and why it is impossible (or unacceptably unpleasant) to solve with the existing language constructs. Examples are strongly recommended.
## Design
Explain the key decisions to be made in designing the feature. This can be organized as fully fleshed out design, a list of design options with pros and cons, or a list of questions to be answered. A proposed feature should have a very strong/clear rationale, but it is ok if many key design questions are open--the Move community and core contributors can help with this.
```

A Move core contributor will either add a `proposed_feature_to_be_discussed` tag and queue the feature for discussion at a future Move community meeting (and change the "Status" to reflect the meeting date), or will request changes that must be made to the issue before it is ready for discussion.
54 changes: 54 additions & 0 deletions third_party/move/GRAVEYARD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Language feature idea graveyard

Move is a smart contract language that counts minimalism as one of its guiding principles. Features are often proposed, but not always implemented. This list exists to record feature proposals that did not progress to acceptance. The goal of maintaining this list is to avoid duplicate proposals, and to explain the rationale for not moving forward with an idea that might seem promising at first blush.

## Pure data structs

### Decision
We should let adapters decide how to handle this

### Rationale
Structs being passed to transactions cause safety issues because deserialization can circumvent modular encapsulation. For example, below make is the only way to create S and the program guarantees that field x is always greater zero; however, if S is obtained via deserialization, this constraint can be violated::
```
struct S has drop, copy { x: u64 }
public fun make(x: u64) { assert!(x > 0); S{x} }
fun(entry) foo(s: S/*no guarantee about s.x*/) { … }
```

## Native structs

### Decision
This is obsolete as regular structs can be used from native code, e.g. struct S { native_handle: u128 }

### Rationale
As Move evolves to an extensible language, native structs are an important tool for extensibility. However, support for native structs has been removed from the VM (though still supported in compiler and file format).

### Design
Bring back support for native structs in the VM. They can use a simple uniform representation via handles which are managed by the runtime environment (like u128 or u256 for each and every native struct value), so implementation effort should be small.

## Signer relaxation for `move_to`

### Decision
Tables and framework-specific workarounds like `ResourceAccount` make this unneccessary.

### Rationale
In some usage scenarios of Move, it does not make sense to only allow move_to<R>(s, x) with s a signer. For instance, when Move is running on the EVM, storage is not owned and paid for by the account owner, but by the contract caller, which manages the accounts on behalf of owners. In general, the signer requirement allows one to only create new resources at addresses for which the transaction has a signer, which disables the capability to manage resource collections on behalf of others.

## Design (Option A)
Drop the requirement of passing a signer to move-to all together. For downwards compatibility reasons, the compiler allows passing either a signer or an address. Rationale for this quite radical step is that in-real world contracts (e.g. the Diem Payment Network) more complex access control patterns than enabled by signer/move_to are needed anyway. Moreover, since only modules which declare a resource R can call move_to<R>, preventing publishing without a signer can still be modeled by modular encapsulation.

### Design (Option B)
Use an attribute on struct declarations to indicate a signer is not required for publishing this struct.

### Design (Option C)
Have another function which does not require a signer, e.g. move_to_address. This, however, raises questions of adequate naming and methodology (when to use which function, should there be constraints when which function is allowed, etc.)

### Design (Option D)
Add no new features and ask clients that want this feature (e.g., the Move -> EVM compilation effort) to implement it via design patterns and/or native functions. See SignerCapability in the Starcoin Account code for one example of a design pattern for (effectively) implementing move_to_address without changing the language.

### Design (Option E)
Support this via a new internal ability that allows framework designers to implement more powerful native functions with the same encapsulation guarantees as bytecodes. For example, the framework designer can define a function `public native fun move_to_address<T: internal>(a: address, t: T)` that can only be invoked on `T`’s declared in the calling module.

### Design (Option F)
Use tables when there is a need to index storage without signer.
Loading

0 comments on commit 3194977

Please sign in to comment.