diff --git a/.cargo/config.toml b/.cargo/config.toml index d7681b6c2..bad1b2c66 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -21,6 +21,15 @@ rustflags = ["--cfg", "tokio_unstable", "-C", "force-frame-pointers=yes", "-C", [target.x86_64-unknown-linux-gnu] rustflags = ["--cfg", "tokio_unstable", "-C", "link-arg=-fuse-ld=lld", "-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes", "-C", "target-feature=+sse4.2"] +[target.aarch64-unknown-linux-gnu] +rustflags = [ + "--cfg", "tokio_unstable", + "-C", "link-arg=-fuse-ld=lld", + "-C", "force-frame-pointers=yes", + "-C", "force-unwind-tables=yes", + "-C", "target-feature=+neon" +] + # 64 bit MSVC [target.x86_64-pc-windows-msvc] rustflags = [ @@ -32,4 +41,4 @@ rustflags = [ "force-unwind-tables=yes", "-C", "link-arg=/STACK:8000000" # Set stack to 8 MB -] +] \ No newline at end of file diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 604c79c45..3d45d8492 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -30,8 +30,16 @@ jobs: - name: Run Cargo Check in nix environment run: nix develop --command bash -c "cargo check" + # - name: Prebuild binaries in nix environment + # run: nix develop --command bash -c "./scripts/build/prebuild" + - name: Run M1 DA Light Node tests in nix environment - run: nix develop --command bash -c "just m1-da-light-node test.local -t=false" + # adjust the log level while debugging + run: CELESTIA_LOG_LEVEL=FATAL MOVEMENT_PREBUILT=false nix develop --command bash -c "just m1-da-light-node test.local -t=false" + + - name: Print available filesystem space + run: df -h - - name: Run monza tests in nix environment - run: nix develop --command bash -c "just monza-full-node test.local -t=false" \ No newline at end of file + - name: Run suzuka tests in nix environment + # adjust the log level while debugging + run: CELESTIA_LOG_LEVEL=FATAL MOVEMENT_PREBUILT=false nix develop --command bash -c "just suzuka-full-node test.local -t=false" \ No newline at end of file diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml new file mode 100644 index 000000000..aecbffd5c --- /dev/null +++ b/.github/workflows/containers.yml @@ -0,0 +1,30 @@ +name: Containers + +on: + push: + +jobs: + containers: + if: false # Remove this line to enable the job + strategy: + matrix: + architecture: [x86_64, arm64] + + runs-on: ${{ matrix.architecture == 'x86_64' && 'movement-runner' || 'buildjet-16vcpu-ubuntu-2204-arm' }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Build and Push Docker image movement + run: | + ./scripts/movement/build-push-image movement diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index f0c7d6e98..000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - { - "associatedIndex": 3 -} - - - - { - "keyToString": { - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "RunOnceActivity.rust.reset.selective.auto.import": "true", - "git-widget-placeholder": "monza", - "last_opened_file_path": "/Users/l-monninger/dev/sdk", - "node.js.detected.package.eslint": "true", - "node.js.detected.package.tslint": "true", - "node.js.selected.package.eslint": "(autodetect)", - "node.js.selected.package.tslint": "(autodetect)", - "nodejs_package_manager_path": "npm", - "org.rust.cargo.project.model.PROJECT_DISCOVERY": "true", - "org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "", - "org.rust.first.attach.projects": "true", - "vue.rearranger.settings.migration": "true" - } -} - - - - - - - 1712319327485 - - - - - - \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index b35dc3c36..6ee5fe5df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,7 +11,7 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "abstract-domain-derive" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "proc-macro2 1.0.81", "quote 1.0.36", @@ -211,7 +211,7 @@ checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "aptos-abstract-gas-usage" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-gas-algebra", @@ -224,7 +224,7 @@ dependencies = [ [[package]] name = "aptos-accumulator" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto", @@ -234,7 +234,7 @@ dependencies = [ [[package]] name = "aptos-aggregator" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-logger", @@ -249,7 +249,7 @@ dependencies = [ [[package]] name = "aptos-api" version = "0.2.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-api-types", @@ -295,7 +295,7 @@ dependencies = [ [[package]] name = "aptos-api-types" version = "0.0.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-config", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "aptos-bcs-utils" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "hex", @@ -334,7 +334,7 @@ dependencies = [ [[package]] name = "aptos-bitvec" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "serde", "serde_bytes", @@ -343,7 +343,7 @@ dependencies = [ [[package]] name = "aptos-block-executor" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-aggregator", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "aptos-block-partitioner" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto", @@ -401,7 +401,7 @@ dependencies = [ [[package]] name = "aptos-bounded-executor" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "futures", "rustversion", @@ -411,7 +411,7 @@ dependencies = [ [[package]] name = "aptos-build-info" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "shadow-rs", ] @@ -419,7 +419,7 @@ dependencies = [ [[package]] name = "aptos-cached-packages" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-framework", @@ -434,7 +434,7 @@ dependencies = [ [[package]] name = "aptos-channels" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-infallible", @@ -446,7 +446,7 @@ dependencies = [ [[package]] name = "aptos-compression" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-logger", "aptos-metrics-core", @@ -458,7 +458,7 @@ dependencies = [ [[package]] name = "aptos-config" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "aptos-consensus-types" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-bitvec", @@ -504,20 +504,18 @@ dependencies = [ "aptos-short-hex-str", "aptos-types", "bcs 0.1.4", - "futures", "itertools 0.10.5", "mirai-annotations", "once_cell", "rand 0.7.3", "rayon", "serde", - "tokio", ] [[package]] name = "aptos-crypto" version = "0.0.3" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto-derive", @@ -563,7 +561,7 @@ dependencies = [ [[package]] name = "aptos-crypto-derive" version = "0.0.3" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "proc-macro2 1.0.81", "quote 1.0.36", @@ -573,7 +571,7 @@ dependencies = [ [[package]] name = "aptos-data-client" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-config", "aptos-crypto", @@ -604,7 +602,7 @@ dependencies = [ [[package]] name = "aptos-db" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-accumulator", @@ -652,7 +650,7 @@ dependencies = [ [[package]] name = "aptos-db-indexer" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-config", @@ -679,12 +677,11 @@ dependencies = [ [[package]] name = "aptos-dkg" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto", "aptos-crypto-derive", - "aptos-runtimes", "bcs 0.1.4", "bellman", "blst", @@ -712,7 +709,7 @@ dependencies = [ [[package]] name = "aptos-drop-helper" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-experimental-runtimes", "aptos-infallible", @@ -724,7 +721,7 @@ dependencies = [ [[package]] name = "aptos-event-notifications" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-channels", @@ -741,7 +738,7 @@ dependencies = [ [[package]] name = "aptos-executor" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-block-partitioner", @@ -775,7 +772,7 @@ dependencies = [ [[package]] name = "aptos-executor-service" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-block-partitioner", @@ -812,7 +809,7 @@ dependencies = [ [[package]] name = "aptos-executor-test-helpers" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-cached-packages", @@ -835,7 +832,7 @@ dependencies = [ [[package]] name = "aptos-executor-types" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-block-partitioner", @@ -857,7 +854,7 @@ dependencies = [ [[package]] name = "aptos-experimental-runtimes" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-runtimes", "core_affinity", @@ -865,13 +862,12 @@ dependencies = [ "num_cpus", "once_cell", "rayon", - "tokio", ] [[package]] name = "aptos-faucet-core" version = "2.0.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-config", @@ -905,7 +901,7 @@ dependencies = [ [[package]] name = "aptos-faucet-metrics-server" version = "2.0.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-logger", @@ -920,7 +916,7 @@ dependencies = [ [[package]] name = "aptos-framework" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-aggregator", @@ -995,7 +991,7 @@ dependencies = [ [[package]] name = "aptos-gas-algebra" version = "0.0.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "either", "move-core-types", @@ -1004,7 +1000,7 @@ dependencies = [ [[package]] name = "aptos-gas-meter" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-gas-algebra", "aptos-gas-schedule", @@ -1020,7 +1016,7 @@ dependencies = [ [[package]] name = "aptos-gas-profiling" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-framework", @@ -1043,7 +1039,7 @@ dependencies = [ [[package]] name = "aptos-gas-schedule" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-gas-algebra", "aptos-global-constants", @@ -1058,7 +1054,7 @@ dependencies = [ [[package]] name = "aptos-genesis" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-cached-packages", @@ -1083,22 +1079,22 @@ dependencies = [ [[package]] name = "aptos-global-constants" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" [[package]] name = "aptos-id-generator" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" [[package]] name = "aptos-infallible" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" [[package]] name = "aptos-jellyfish-merkle" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto", @@ -1126,7 +1122,7 @@ dependencies = [ [[package]] name = "aptos-keygen" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-crypto", "aptos-types", @@ -1136,7 +1132,7 @@ dependencies = [ [[package]] name = "aptos-language-e2e-tests" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-abstract-gas-usage", @@ -1183,7 +1179,7 @@ dependencies = [ [[package]] name = "aptos-ledger" version = "0.2.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-crypto", "aptos-types", @@ -1197,7 +1193,7 @@ dependencies = [ [[package]] name = "aptos-log-derive" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "proc-macro2 1.0.81", "quote 1.0.36", @@ -1207,7 +1203,7 @@ dependencies = [ [[package]] name = "aptos-logger" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-infallible", "aptos-log-derive", @@ -1228,7 +1224,7 @@ dependencies = [ [[package]] name = "aptos-memory-usage-tracker" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-gas-algebra", "aptos-gas-meter", @@ -1242,7 +1238,7 @@ dependencies = [ [[package]] name = "aptos-mempool" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-bounded-executor", @@ -1282,7 +1278,7 @@ dependencies = [ [[package]] name = "aptos-mempool-notifications" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-runtimes", "aptos-types", @@ -1296,7 +1292,7 @@ dependencies = [ [[package]] name = "aptos-memsocket" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-infallible", "bytes", @@ -1307,7 +1303,7 @@ dependencies = [ [[package]] name = "aptos-metrics-core" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "prometheus", @@ -1316,7 +1312,7 @@ dependencies = [ [[package]] name = "aptos-move-stdlib" version = "0.1.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-gas-schedule", @@ -1342,7 +1338,7 @@ dependencies = [ [[package]] name = "aptos-mvhashmap" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-aggregator", @@ -1365,7 +1361,7 @@ dependencies = [ [[package]] name = "aptos-native-interface" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-gas-algebra", "aptos-gas-schedule", @@ -1382,7 +1378,7 @@ dependencies = [ [[package]] name = "aptos-netcore" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-memsocket", "aptos-proxy", @@ -1399,7 +1395,7 @@ dependencies = [ [[package]] name = "aptos-network" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-bitvec", @@ -1447,7 +1443,7 @@ dependencies = [ [[package]] name = "aptos-node-resource-metrics" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-build-info", "aptos-infallible", @@ -1463,7 +1459,7 @@ dependencies = [ [[package]] name = "aptos-num-variants" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "proc-macro2 1.0.81", "quote 1.0.36", @@ -1473,7 +1469,7 @@ dependencies = [ [[package]] name = "aptos-openapi" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "async-trait", "percent-encoding", @@ -1486,7 +1482,7 @@ dependencies = [ [[package]] name = "aptos-package-builder" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-framework", @@ -1499,7 +1495,7 @@ dependencies = [ [[package]] name = "aptos-peer-monitoring-service-types" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-config", "aptos-types", @@ -1512,7 +1508,7 @@ dependencies = [ [[package]] name = "aptos-proptest-helpers" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "crossbeam", "proptest", @@ -1522,7 +1518,7 @@ dependencies = [ [[package]] name = "aptos-protos" version = "1.3.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "futures-core", "pbjson", @@ -1535,7 +1531,7 @@ dependencies = [ [[package]] name = "aptos-proxy" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "ipnet", ] @@ -1543,7 +1539,7 @@ dependencies = [ [[package]] name = "aptos-push-metrics" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-logger", "aptos-metrics-core", @@ -1554,7 +1550,7 @@ dependencies = [ [[package]] name = "aptos-rate-limiter" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-infallible", "aptos-logger", @@ -1568,7 +1564,7 @@ dependencies = [ [[package]] name = "aptos-rest-client" version = "0.0.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-api-types", @@ -1594,7 +1590,7 @@ dependencies = [ [[package]] name = "aptos-retrier" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-logger", "tokio", @@ -1603,7 +1599,7 @@ dependencies = [ [[package]] name = "aptos-rocksdb-options" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-config", "rocksdb", @@ -1612,7 +1608,7 @@ dependencies = [ [[package]] name = "aptos-runtimes" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "rayon", "tokio", @@ -1621,7 +1617,7 @@ dependencies = [ [[package]] name = "aptos-schemadb" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-infallible", @@ -1638,7 +1634,7 @@ dependencies = [ [[package]] name = "aptos-scratchpad" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-crypto", "aptos-drop-helper", @@ -1658,7 +1654,7 @@ dependencies = [ [[package]] name = "aptos-sdk" version = "0.0.3" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-api-types", @@ -1679,7 +1675,7 @@ dependencies = [ [[package]] name = "aptos-sdk-builder" version = "0.2.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-types", @@ -1698,7 +1694,7 @@ dependencies = [ [[package]] name = "aptos-secure-net" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-logger", "aptos-metrics-core", @@ -1717,7 +1713,7 @@ dependencies = [ [[package]] name = "aptos-secure-storage" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto", @@ -1739,7 +1735,7 @@ dependencies = [ [[package]] name = "aptos-short-hex-str" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "mirai-annotations", "serde", @@ -1750,7 +1746,7 @@ dependencies = [ [[package]] name = "aptos-speculative-state-helper" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-infallible", @@ -1762,7 +1758,7 @@ dependencies = [ [[package]] name = "aptos-storage-interface" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-crypto", @@ -1794,7 +1790,7 @@ dependencies = [ [[package]] name = "aptos-storage-service-client" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-channels", "aptos-config", @@ -1808,7 +1804,7 @@ dependencies = [ [[package]] name = "aptos-storage-service-types" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-compression", "aptos-config", @@ -1824,7 +1820,7 @@ dependencies = [ [[package]] name = "aptos-table-natives" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-gas-schedule", @@ -1845,7 +1841,7 @@ dependencies = [ [[package]] name = "aptos-temppath" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "hex", "rand 0.7.3", @@ -1854,7 +1850,7 @@ dependencies = [ [[package]] name = "aptos-time-service" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-infallible", "enum_dispatch", @@ -1867,7 +1863,7 @@ dependencies = [ [[package]] name = "aptos-types" version = "0.0.3" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-bitvec", @@ -1918,12 +1914,12 @@ dependencies = [ [[package]] name = "aptos-utils" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" [[package]] name = "aptos-vault-client" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-crypto", "base64 0.13.1", @@ -1939,7 +1935,7 @@ dependencies = [ [[package]] name = "aptos-vm" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-aggregator", @@ -1973,7 +1969,6 @@ dependencies = [ "dashmap", "derive_more", "fail 0.5.1", - "futures", "hex", "jsonwebtoken", "move-binary-format", @@ -1996,7 +1991,7 @@ dependencies = [ [[package]] name = "aptos-vm-genesis" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-cached-packages", @@ -2018,7 +2013,7 @@ dependencies = [ [[package]] name = "aptos-vm-logging" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "aptos-crypto", "aptos-logger", @@ -2033,7 +2028,7 @@ dependencies = [ [[package]] name = "aptos-vm-types" version = "0.0.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-aggregator", @@ -2054,7 +2049,7 @@ dependencies = [ [[package]] name = "aptos-vm-validator" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "aptos-event-notifications", @@ -4300,16 +4295,6 @@ dependencies = [ "syn 2.0.60", ] -[[package]] -name = "env_filter" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -4319,19 +4304,6 @@ dependencies = [ "log", ] -[[package]] -name = "env_logger" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -5150,12 +5122,6 @@ dependencies = [ "libm", ] -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.28" @@ -5440,7 +5406,7 @@ dependencies = [ "crossbeam-channel", "crossbeam-utils", "dashmap", - "env_logger 0.10.2", + "env_logger", "indexmap 2.2.6", "is-terminal", "itoa", @@ -6027,7 +5993,7 @@ dependencies = [ "async-stream", "celestia-rpc", "celestia-types", - "env_logger 0.11.3", + "chrono", "hex", "m1-da-light-node-grpc", "m1-da-light-node-util", @@ -6168,13 +6134,13 @@ dependencies = [ "clap 4.5.4", "derive_more", "dirs 3.0.2", - "env_logger 0.11.3", "fail 0.5.1", "futures", "hex", "lazy_static", "log", "maptos-execution-util", + "movement-types", "poem", "poem-openapi", "rand 0.7.3", @@ -6210,6 +6176,34 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "mcr-settlement-client" +version = "0.3.0" +dependencies = [ + "anyhow", + "async-stream", + "async-trait", + "futures", + "movement-types", + "serde_json", + "tokio", + "tokio-stream", +] + +[[package]] +name = "mcr-settlement-manager" +version = "0.3.0" +dependencies = [ + "anyhow", + "async-stream", + "async-trait", + "mcr-settlement-client", + "movement-types", + "serde_json", + "tokio", + "tokio-stream", +] + [[package]] name = "memchr" version = "2.7.2" @@ -6371,6 +6365,7 @@ dependencies = [ "log", "maptos-execution-util", "maptos-opt-executor", + "movement-types", "poem-openapi", "rand 0.7.3", "rand_core 0.5.1", @@ -6440,7 +6435,6 @@ version = "0.3.0" dependencies = [ "anyhow", "async-channel", - "env_logger 0.11.3", "m1-da-light-node-client", "monza-executor", "movement-types", @@ -6462,7 +6456,7 @@ checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" [[package]] name = "move-abigen" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6479,7 +6473,7 @@ dependencies = [ [[package]] name = "move-binary-format" version = "0.0.3" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "backtrace", @@ -6494,12 +6488,12 @@ dependencies = [ [[package]] name = "move-borrow-graph" version = "0.0.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" [[package]] name = "move-bytecode-source-map" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6514,7 +6508,7 @@ dependencies = [ [[package]] name = "move-bytecode-utils" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "move-binary-format", @@ -6526,7 +6520,7 @@ dependencies = [ [[package]] name = "move-bytecode-verifier" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "fail 0.4.0", @@ -6541,7 +6535,7 @@ dependencies = [ [[package]] name = "move-bytecode-viewer" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "clap 4.5.4", @@ -6558,7 +6552,7 @@ dependencies = [ [[package]] name = "move-cli" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6604,7 +6598,7 @@ dependencies = [ [[package]] name = "move-command-line-common" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "difference", @@ -6621,7 +6615,7 @@ dependencies = [ [[package]] name = "move-compiler" version = "0.0.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6650,7 +6644,7 @@ dependencies = [ [[package]] name = "move-compiler-v2" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "abstract-domain-derive", "anyhow", @@ -6683,7 +6677,7 @@ dependencies = [ [[package]] name = "move-core-types" version = "0.0.4" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "arbitrary", @@ -6708,7 +6702,7 @@ dependencies = [ [[package]] name = "move-coverage" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6728,7 +6722,7 @@ dependencies = [ [[package]] name = "move-disassembler" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "clap 4.5.4", @@ -6746,7 +6740,7 @@ dependencies = [ [[package]] name = "move-docgen" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "codespan", @@ -6765,7 +6759,7 @@ dependencies = [ [[package]] name = "move-errmapgen" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6779,7 +6773,7 @@ dependencies = [ [[package]] name = "move-ir-compiler" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6798,7 +6792,7 @@ dependencies = [ [[package]] name = "move-ir-to-bytecode" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "codespan-reporting", @@ -6817,7 +6811,7 @@ dependencies = [ [[package]] name = "move-ir-to-bytecode-syntax" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "hex", @@ -6830,7 +6824,7 @@ dependencies = [ [[package]] name = "move-ir-types" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "hex", @@ -6844,7 +6838,7 @@ dependencies = [ [[package]] name = "move-model" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "codespan", @@ -6872,7 +6866,7 @@ dependencies = [ [[package]] name = "move-package" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6909,7 +6903,7 @@ dependencies = [ [[package]] name = "move-prover" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "async-trait", @@ -6948,7 +6942,7 @@ dependencies = [ [[package]] name = "move-prover-boogie-backend" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "async-trait", @@ -6978,7 +6972,7 @@ dependencies = [ [[package]] name = "move-prover-bytecode-pipeline" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "abstract-domain-derive", "anyhow", @@ -7009,7 +7003,7 @@ dependencies = [ [[package]] name = "move-resource-viewer" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -7037,7 +7031,7 @@ dependencies = [ [[package]] name = "move-stackless-bytecode" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "abstract-domain-derive", "codespan", @@ -7064,7 +7058,7 @@ dependencies = [ [[package]] name = "move-stdlib" version = "0.1.1" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "hex", @@ -7087,7 +7081,7 @@ dependencies = [ [[package]] name = "move-symbol-pool" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "once_cell", "serde", @@ -7096,7 +7090,7 @@ dependencies = [ [[package]] name = "move-table-extension" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bcs 0.1.4", @@ -7114,7 +7108,7 @@ dependencies = [ [[package]] name = "move-unit-test" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "better_any", @@ -7145,7 +7139,7 @@ dependencies = [ [[package]] name = "move-vm-runtime" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "better_any", "bytes", @@ -7170,7 +7164,7 @@ dependencies = [ [[package]] name = "move-vm-test-utils" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "anyhow", "bytes", @@ -7185,7 +7179,7 @@ dependencies = [ [[package]] name = "move-vm-types" version = "0.1.0" -source = "git+https://github.com/movementlabsxyz/aptos-core?rev=7d807dcbd8796e760d272db2fd7903e6d8449730#7d807dcbd8796e760d272db2fd7903e6d8449730" +source = "git+https://github.com/movementlabsxyz/aptos-core?rev=e9b42128f8ed51e90d06beec72d32797693ab66c#e9b42128f8ed51e90d06beec72d32797693ab66c" dependencies = [ "bcs 0.1.4", "derivative", @@ -7204,6 +7198,8 @@ name = "movement-types" version = "0.3.0" dependencies = [ "anyhow", + "aptos-types", + "bcs 0.1.4", "serde", "serde_with", "sha2 0.10.8", @@ -10075,6 +10071,7 @@ dependencies = [ "log", "maptos-execution-util", "maptos-opt-executor", + "movement-types", "poem-openapi", "rand 0.7.3", "rand_core 0.5.1", @@ -10144,8 +10141,9 @@ version = "0.3.0" dependencies = [ "anyhow", "async-channel", - "env_logger 0.11.3", "m1-da-light-node-client", + "mcr-settlement-client", + "mcr-settlement-manager", "movement-types", "serde_json", "sha2 0.10.8", diff --git a/Cargo.toml b/Cargo.toml index 69826273c..fe20ae287 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,9 @@ members = [ "protocol-units/mempool/*", + "protocol-units/settlement/mcr/client", + "protocol-units/settlement/mcr/manager", + "util/*", "util/buildtime/buildtime-helpers", "util/buildtime/buildtime-macros", @@ -34,7 +37,6 @@ license = "MIT OR Apache-2.0" authors = ["Movement Labs"] repository = "www.github.com/movementlabs/movement" homepage = "www.homepage.com" -resolver = "2" publish = false rust-version = "1.75" @@ -61,6 +63,9 @@ m1-da-light-node-grpc = { path = "protocol-units/da/m1/light-node-grpc" } m1-da-light-node-util = { path = "protocol-units/da/m1/util" } m1-da-light-node-verifier = { path = "protocol-units/da/m1/light-node-verifier" } m1-da-light-node-client = { path = "protocol-units/da/m1/light-node-client" } +## settlement +mcr-settlement-client = { path = "protocol-units/settlement/mcr/client" } +mcr-settlement-manager = { path = "protocol-units/settlement/mcr/manager" } ## mempool mempool-util = { path = "protocol-units/mempool/util" } move-rocks = { path = "protocol-units/mempool/move-rocks" } @@ -95,8 +100,6 @@ hex = { version = "0.4.3", default-features = false, features = [ ] } async-trait = "0.1.71" tracing = "0.1.40" -tracing-log = "0.2.0" -env_logger = "0.11.0" tokio = { version = "1.35.1", features = ["full"] } tokio-stream = "0.1.15" async-stream = "0.3.0" @@ -177,33 +180,33 @@ ethers-middleware = { version = "=2.0.10", default-features = false } # Aptos dependencies # We use a forked version so that we can override dependency versions. This is required # to be avoid depenedency conflicts with other Sovereign Labs crates. -aptos-vm = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-sdk = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-consensus-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-crypto = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730", features = [ +aptos-vm = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-sdk = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-consensus-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-crypto = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c", features = [ "cloneable-private-keys", ] } -aptos-db = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-api-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-api = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-storage-interface = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-block-executor = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-vm-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-vm-logging = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-language-e2e-tests = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-framework = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-vm-genesis = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-executor = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-executor-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-executor-test-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-bitvec = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-mempool = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-state-view = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-temppath = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-faucet-core = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } -aptos-proptest-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } +aptos-db = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-api-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-api = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-storage-interface = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-block-executor = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-vm-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-vm-logging = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-language-e2e-tests = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-framework = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-vm-genesis = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-executor = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-executor-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-executor-test-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-bitvec = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-mempool = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-state-view = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-temppath = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-faucet-core = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } +aptos-proptest-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } bcs = { git = "https://github.com/aptos-labs/bcs.git", rev = "d31fab9d81748e2594be5cd5cdf845786a30562d" } move-binary-format = { git = "https://github.com/diem/move" } @@ -226,7 +229,7 @@ secp256k1 = { version = "0.27", default-features = false, features = [ "rand-std", "recovery", ] } -aptos-cached-packages = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "7d807dcbd8796e760d272db2fd7903e6d8449730" } +aptos-cached-packages = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "e9b42128f8ed51e90d06beec72d32797693ab66c" } # celestia dependencies celestia-rpc = { git = "https://github.com/eigerco/lumina" } diff --git a/docker/build/celestia-app/Dockerfile b/docker/build/celestia-app/Dockerfile new file mode 100644 index 000000000..7c1a11fd6 --- /dev/null +++ b/docker/build/celestia-app/Dockerfile @@ -0,0 +1,28 @@ +# Nix builder +FROM nixos/nix:latest AS builder + +# Copy our source and setup our working dir. +COPY . /tmp/build +WORKDIR /tmp/build + +# Build our Nix environment +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + build -A celestia-app + +# Copy the Nix store closure into a directory. The Nix store closure is the +# entire set of Nix store values that we need for our build. +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure + +# Final image is based on scratch. We copy a bunch of Nix dependencies +# but they're fully self-contained so we don't need Nix anymore. +FROM scratch + +WORKDIR /app + +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /tmp/build/result /app +CMD ["/app/bin/app"] \ No newline at end of file diff --git a/docker/build/celestia-node/Dockerfile b/docker/build/celestia-node/Dockerfile new file mode 100644 index 000000000..5050cc8a1 --- /dev/null +++ b/docker/build/celestia-node/Dockerfile @@ -0,0 +1,28 @@ +# Nix builder +FROM nixos/nix:latest AS builder + +# Copy our source and setup our working dir. +COPY . /tmp/build +WORKDIR /tmp/build + +# Build our Nix environment +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + build -A celestia-node + +# Copy the Nix store closure into a directory. The Nix store closure is the +# entire set of Nix store values that we need for our build. +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure + +# Final image is based on scratch. We copy a bunch of Nix dependencies +# but they're fully self-contained so we don't need Nix anymore. +FROM scratch + +WORKDIR /app + +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /tmp/build/result /app +CMD ["/app/bin/app"] \ No newline at end of file diff --git a/docker/build/m1-da-light-node/Dockerfile b/docker/build/m1-da-light-node/Dockerfile index 3158d12ef..9b42922bb 100644 --- a/docker/build/m1-da-light-node/Dockerfile +++ b/docker/build/m1-da-light-node/Dockerfile @@ -1,28 +1,11 @@ # Nix builder -FROM nixos/nix:latest AS builder +FROM nixos/nix:latest # Copy our source and setup our working dir. COPY . /tmp/build WORKDIR /tmp/build -# Build our Nix environment RUN nix \ --extra-experimental-features "nix-command flakes" \ --option filter-syscalls false \ - build - -# Copy the Nix store closure into a directory. The Nix store closure is the -# entire set of Nix store values that we need for our build. -RUN mkdir /tmp/nix-store-closure -RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure - -# Final image is based on scratch. We copy a bunch of Nix dependencies -# but they're fully self-contained so we don't need Nix anymore. -FROM scratch - -WORKDIR /app - -# Copy /nix/store -COPY --from=builder /tmp/nix-store-closure /nix/store -COPY --from=builder /tmp/build/result /app -CMD ["/app/bin/app"] \ No newline at end of file + develop --command bash -c "cargo build" diff --git a/docker/build/monza-full-node/Dockerfile b/docker/build/monza-full-node/Dockerfile index 3158d12ef..f1269517b 100644 --- a/docker/build/monza-full-node/Dockerfile +++ b/docker/build/monza-full-node/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /tmp/build RUN nix \ --extra-experimental-features "nix-command flakes" \ --option filter-syscalls false \ - build + build -A monza-full-node # Copy the Nix store closure into a directory. The Nix store closure is the # entire set of Nix store values that we need for our build. diff --git a/docker/build/movement/Dockerfile b/docker/build/movement/Dockerfile new file mode 100644 index 000000000..f0ba694fd --- /dev/null +++ b/docker/build/movement/Dockerfile @@ -0,0 +1,11 @@ +# Nix builder +FROM nixos/nix:latest + +# Copy our source and setup our working dir. +COPY . /tmp/build +WORKDIR /tmp/build + +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + develop --command bash -c "cargo build --release && cd $MONZA_APTOS_PATH && cargo build --release -p aptos-faucet-service" \ No newline at end of file diff --git a/docker/build/rd/Dockerfile b/docker/build/rd/Dockerfile deleted file mode 100644 index 2d3672e0c..000000000 --- a/docker/build/rd/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Use the latest Nix image -FROM nixos/nix:latest - -# Set up working directory where the flake will be copied -WORKDIR /app - -# Copy the flake files into the container -COPY . /app - -# Set the entrypoint to use `nix develop` to execute commands within the Nix environment -ENTRYPOINT ["nix", "develop", "--command", "bash", "-c"] diff --git a/docker/build/suzuka-full-node/Dockerfile b/docker/build/suzuka-full-node/Dockerfile new file mode 100644 index 000000000..fc5706cf2 --- /dev/null +++ b/docker/build/suzuka-full-node/Dockerfile @@ -0,0 +1,28 @@ +# Nix builder +FROM nixos/nix:latest AS builder + +# Copy our source and setup our working dir. +COPY . /tmp/build +WORKDIR /tmp/build + +# Build our Nix environment +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + build -A suzuka-full-node + +# Copy the Nix store closure into a directory. The Nix store closure is the +# entire set of Nix store values that we need for our build. +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure + +# Final image is based on scratch. We copy a bunch of Nix dependencies +# but they're fully self-contained so we don't need Nix anymore. +FROM scratch + +WORKDIR /app + +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /tmp/build/result /app +CMD ["/app/bin/app"] \ No newline at end of file diff --git a/docker/compose/monza-full-node-monolith/docker-compose.yml b/docker/compose/monza-full-node-monolith/docker-compose.yml new file mode 100644 index 000000000..f7e1f8278 --- /dev/null +++ b/docker/compose/monza-full-node-monolith/docker-compose.yml @@ -0,0 +1,18 @@ +services: + monza-full-node: + image: mvlbs/movement:7cb00d17d88e74a42c201e7993b3c22505d1a833 + container_name: monza-full-node-monolith + ports: + - "30370:30370" # m1 da light node rpc + - "30371:30371" # aptos api + - "30372:30372" # aptos faucet + environment: + - CARGO_PROFILE=release + - MOVEMENT_PREBUILT=true + command: ["nix", "--extra-experimental-features", "nix-command flakes", "develop", "--command", "just", "monza-full-node", "local", "-t=false"] + volumes: + - data-volume:/data + +volumes: + data-volume: + diff --git a/docker/compose/monza-full-node-monolith/prometheus.yml b/docker/compose/monza-full-node-monolith/prometheus.yml new file mode 100644 index 000000000..1055d40b1 --- /dev/null +++ b/docker/compose/monza-full-node-monolith/prometheus.yml @@ -0,0 +1,10 @@ +global: + scrape_interval: 15s + +scrape_configs: + - job_name: 'cadvisor' + static_configs: + - targets: ['cadvisor:8080'] + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] diff --git a/flake.lock b/flake.lock index d0280503b..8b08e39ad 100644 --- a/flake.lock +++ b/flake.lock @@ -71,6 +71,24 @@ "type": "github" } }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1713520724, + "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", + "owner": "nix-community", + "repo": "naersk", + "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1666753130, @@ -86,6 +104,20 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1715774670, + "narHash": "sha256-iJYnKMtLi5u6hZhJm94cRNSDG5Rz6ZzIkGbhPFtDRm0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b3fcfcfabd01b947a1e4f36622bbffa3985bdac6", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1715266358, "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=", @@ -101,7 +133,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -121,14 +153,15 @@ "inputs": { "flake-utils": "flake-utils", "foundry": "foundry", - "nixpkgs": "nixpkgs_2", + "naersk": "naersk", + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay" } }, "rust-overlay": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1712024007, diff --git a/flake.nix b/flake.nix index b3e9318b2..dcbd520c5 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ rust-overlay.url = "github:oxalica/rust-overlay"; flake-utils.url = "github:numtide/flake-utils"; foundry.url = "github:shazow/foundry.nix/monthly"; + naersk.url = "github:nix-community/naersk"; }; outputs = { @@ -12,12 +13,21 @@ rust-overlay, flake-utils, foundry, + naersk, ... }: flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-darwin" "x86_64-linux" "aarch64-linux"] ( system: let + # nix does not handle .cargo/config.toml + RUSTFLAGS = if pkgs.stdenv.hostPlatform.isLinux then + "--cfg tokio_unstable -C force-frame-pointers=yes -C force-unwind-tables=yes -C link-arg=-fuse-ld=lld -C target-feature=+sse4.2" + else if pkgs.stdenv.hostPlatform.isWindows then + "--cfg tokio_unstable -C force-frame-pointers=yes -C force-unwind-tables=yes -C link-arg=/STACK:8000000" + else + "--cfg tokio_unstable -C force-frame-pointers=yes -C force-unwind-tables=yes"; + overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)); overlays = [ @@ -32,8 +42,9 @@ frameworks = pkgs.darwin.apple_sdk.frameworks; dependencies = with pkgs; [ + rocksdb foundry-bin - solc + # solc llvmPackages.bintools openssl openssl.dev @@ -63,6 +74,8 @@ ] ++ lib.optionals stdenv.isLinux [ udev systemd + snappy + bzip2 ]; # Specific version of toolchain @@ -73,6 +86,11 @@ rustc = rust; }; + naersk' = pkgs.callPackage naersk { + cargo = rust; + rustc = rust; + }; + # celestia-node celestia-node = import ./nix/celestia-node.nix { inherit pkgs; }; @@ -80,7 +98,11 @@ celestia-app = import ./nix/celestia-app.nix { inherit pkgs; }; # monza-aptos + # FIXME: rename, should not be specific to Monza monza-aptos = import ./nix/monza-aptos.nix { inherit pkgs; }; + + # m1-da-light-node + m1-da-light-node = import ./nix/m1-da-light-node.nix { inherit pkgs frameworks RUSTFLAGS; }; in with pkgs; { @@ -88,18 +110,26 @@ # Monza Aptos packages.monza-aptos = monza-aptos; + # M1 DA Light Node + packages.m1-da-light-node = m1-da-light-node; + # Development Shell devShells.default = mkShell { + ROCKSDB=pkgs.rocksdb; + + # for linux set SNAPPY variable + SNAPPY = if stdenv.isLinux then pkgs.snappy else null; + OPENSSL_DEV=pkgs.openssl.dev; PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; buildInputs = dependencies; nativeBuildInputs = dependencies; shellHook = '' - #!/bin/bash + #!/usr/bin/env bash export MONZA_APTOS_PATH=$(nix path-info -r .#monza-aptos | tail -n 1) - install-foundry + echo "Monza Aptos Path: $MONZA_APTOS_PATH" cat <<'EOF' _ _ __ _ _ ____ _ _ ____ __ _ ____ ( \/ ) / \ / )( \( __)( \/ )( __)( ( \(_ _) @@ -110,6 +140,7 @@ echo "Develop with Move Anywhere" ''; }; + } ); } \ No newline at end of file diff --git a/justfile b/justfile index abd7418cb..36b296ae8 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,10 @@ m1-da-light-node FEATURES *ARGS: - cargo build -p m1-da-light-node - scripts/movement/run m1-da-light-node {{ FEATURES }} {{ ARGS }} + ./scripts/movement/run m1-da-light-node {{ FEATURES }} {{ ARGS }} monza-full-node FEATURES *ARGS: - scripts/movement/run monza-full-node {{ FEATURES }} {{ ARGS }} + ./scripts/movement/run monza-full-node {{ FEATURES }} {{ ARGS }} +suzuka-full-node FEATURES *ARGS: + ./scripts/movement/run suzuka-full-node {{ FEATURES }} {{ ARGS }} mcr-contract-tests: - cd ./protocol-units/settlement/mcr/contracts && forge test \ No newline at end of file + cd ./protocol-units/settlement/mcr/contracts && forge test +build-push-container IMAGE: + ./scripts/movement/build-push-image {{ IMAGE }} \ No newline at end of file diff --git a/networks/monza/monza-full-node/Cargo.toml b/networks/monza/monza-full-node/Cargo.toml index 37cf44077..cfe3821b2 100644 --- a/networks/monza/monza-full-node/Cargo.toml +++ b/networks/monza/monza-full-node/Cargo.toml @@ -19,12 +19,11 @@ serde_json = { workspace = true } anyhow = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } +tracing = { workspace = true } sha2 = { workspace = true } tonic = { workspace = true } movement-types = { workspace = true } -env_logger = { workspace = true, optional = true } -tracing = { workspace = true, optional = true } tracing-subscriber = { workspace = true, optional = true } [features] @@ -32,8 +31,6 @@ default = [ "logging" ] logging = [ - "env_logger", - "tracing", "tracing-subscriber" ] diff --git a/networks/monza/monza-full-node/src/partial.rs b/networks/monza/monza-full-node/src/partial.rs index a262d11b2..b65297904 100644 --- a/networks/monza/monza-full-node/src/partial.rs +++ b/networks/monza/monza-full-node/src/partial.rs @@ -1,6 +1,13 @@ use std::{sync::Arc, time::Duration}; use anyhow::Context; +use async_channel::{Sender, Receiver}; +use sha2::Digest; +use tokio_stream::StreamExt; +use tokio::sync::RwLock; +use tracing::debug; + +use movement_types::Block; use monza_executor::{ MonzaExecutor, ExecutableBlock, @@ -12,14 +19,9 @@ use monza_executor::{ ExecutableTransactions, v1::MonzaExecutorV1, }; +// FIXME: glob imports are bad style use m1_da_light_node_client::*; -use async_channel::{Sender, Receiver}; -use sha2::Digest; use crate::*; -use tokio_stream::StreamExt; -use tokio::sync::RwLock; -use movement_types::Block; - #[derive(Clone)] pub struct MonzaPartialNode { @@ -62,12 +64,13 @@ impl MonzaPartialNode { let mut transactions = Vec::new(); - while let Ok(transaction_result) = tokio::time::timeout(Duration::from_millis(100), self.transaction_receiver.recv()).await { match transaction_result { Ok(transaction) => { - println!("Got transaction: {:?}", transaction); + + debug!("Got transaction: {:?}", transaction); + let serialized_transaction = serde_json::to_vec(&transaction)?; transactions.push(BlobWrite { data: serialized_transaction @@ -91,7 +94,9 @@ impl MonzaPartialNode { blobs: transactions } ).await?; - println!("Wrote transactions to DA"); + + tracing::debug!("Wrote transactions to DA"); + } Ok(()) @@ -125,21 +130,34 @@ impl MonzaPartialNode { while let Some(blob) = stream.next().await { - println!("Stream hot!"); + debug!("Got blob: {:?}", blob); + // get the block - let block_bytes = match blob?.blob.ok_or(anyhow::anyhow!("No blob in response"))?.blob_type.ok_or(anyhow::anyhow!("No blob type in response"))? { + let (block_bytes, block_timestamp, block_id) = match blob?.blob.ok_or(anyhow::anyhow!("No blob in response"))?.blob_type.ok_or(anyhow::anyhow!("No blob type in response"))? { blob_response::BlobType::SequencedBlobBlock(blob) => { - blob.data + (blob.data, blob.timestamp, blob.blob_id) }, _ => { anyhow::bail!("Invalid blob type in response") } }; // get the block let block : Block = serde_json::from_slice(&block_bytes)?; - println!("Received block: {:?}", block); + + debug!("Got block: {:?}", block); // get the transactions let mut block_transactions = Vec::new(); + let block_metadata = self.executor.build_block_metadata( + HashValue::sha3_256_of(block_id.as_bytes()), + block_timestamp + ).await?; + let block_metadata_transaction = SignatureVerifiedTransaction::Valid( + Transaction::BlockMetadata( + block_metadata + ) + ); + block_transactions.push(block_metadata_transaction); + for transaction in block.transactions { let signed_transaction : SignedTransaction = serde_json::from_slice(&transaction.0)?; let signature_verified_transaction = SignatureVerifiedTransaction::Valid( @@ -172,7 +190,7 @@ impl MonzaPartialNode { executable_block ).await?; - println!("Executed block: {:?}", block_id); + debug!("Executed block: {:?}", block_id); } @@ -223,7 +241,7 @@ impl MonzaPartialNode { pub async fn try_from_env() -> Result { let (tx, _) = async_channel::unbounded(); - let light_node_client = LightNodeServiceClient::connect("http://[::1]:30730").await?; + let light_node_client = LightNodeServiceClient::connect("http://0.0.0.0:30730").await?; let executor = MonzaExecutorV1::try_from_env(tx).await.context( "Failed to get executor from environment" )?; diff --git a/networks/suzuka/suzuka-full-node/Cargo.toml b/networks/suzuka/suzuka-full-node/Cargo.toml index 32f734865..a36883226 100644 --- a/networks/suzuka/suzuka-full-node/Cargo.toml +++ b/networks/suzuka/suzuka-full-node/Cargo.toml @@ -14,6 +14,8 @@ rust-version = { workspace = true } [dependencies] suzuka-executor = { workspace = true } m1-da-light-node-client = { workspace = true } +mcr-settlement-client = { workspace = true, features = ["mock"] } +mcr-settlement-manager = { workspace = true } async-channel = { workspace = true } serde_json = { workspace = true } anyhow = { workspace = true } @@ -21,10 +23,9 @@ tokio = { workspace = true } tokio-stream = { workspace = true } sha2 = { workspace = true } tonic = { workspace = true } +tracing = { workspace = true } movement-types = { workspace = true } -env_logger = { workspace = true, optional = true } -tracing = { workspace = true, optional = true } tracing-subscriber = { workspace = true, optional = true } [features] @@ -32,8 +33,6 @@ default = [ "logging" ] logging = [ - "env_logger", - "tracing", "tracing-subscriber" ] diff --git a/networks/suzuka/suzuka-full-node/src/main.rs b/networks/suzuka/suzuka-full-node/src/main.rs index d98db0ea3..939e2c866 100644 --- a/networks/suzuka/suzuka-full-node/src/main.rs +++ b/networks/suzuka/suzuka-full-node/src/main.rs @@ -18,10 +18,12 @@ async fn main() -> Result<(), anyhow::Error> { } - let executor = SuzukaPartialNode::try_from_env().await.context( + let (executor, background_task) = SuzukaPartialNode::try_from_env().await.context( "Failed to create the executor" )?; + tokio::spawn(background_task); + executor.run().await.context( "Failed to run the executor" )?; diff --git a/networks/suzuka/suzuka-full-node/src/partial.rs b/networks/suzuka/suzuka-full-node/src/partial.rs index 94534bcd9..c999fefd2 100644 --- a/networks/suzuka/suzuka-full-node/src/partial.rs +++ b/networks/suzuka/suzuka-full-node/src/partial.rs @@ -1,57 +1,78 @@ -use std::{sync::Arc, time::Duration}; - -use anyhow::Context; +use crate::SuzukaFullNode; +use m1_da_light_node_client::{ + blob_response, BatchWriteRequest, BlobWrite, LightNodeServiceClient, + StreamReadFromHeightRequest, +}; +use mcr_settlement_client::{mock::MockMcrSettlementClient, McrSettlementClientOperations}; +use mcr_settlement_manager::{ + CommitmentEventStream, McrSettlementManager, McrSettlementManagerOperations, +}; +use movement_types::{Block, BlockCommitmentEvent}; use suzuka_executor::{ - SuzukaExecutor, - ExecutableBlock, - HashValue, - FinalityMode, - Transaction, - SignatureVerifiedTransaction, - SignedTransaction, - ExecutableTransactions, - v1::SuzukaExecutorV1, + v1::SuzukaExecutorV1, ExecutableBlock, ExecutableTransactions, FinalityMode, HashValue, + SignatureVerifiedTransaction, SignedTransaction, SuzukaExecutor, Transaction, }; -use m1_da_light_node_client::*; -use async_channel::{Sender, Receiver}; + +use anyhow::Context; +use async_channel::{Receiver, Sender}; use sha2::Digest; -use crate::*; -use tokio_stream::StreamExt; use tokio::sync::RwLock; -use movement_types::Block; - - -#[derive(Clone)] -pub struct SuzukaPartialNode { - executor: T, - transaction_sender : Sender, - pub transaction_receiver : Receiver, - light_node_client: Arc>>, +use tokio_stream::StreamExt; +use tracing::debug; + +use std::future::Future; +use std::sync::Arc; +use std::time::Duration; + +pub struct SuzukaPartialNode { + executor: T, + transaction_sender: Sender, + pub transaction_receiver: Receiver, + light_node_client: Arc>>, + settlement_manager: McrSettlementManager, } -impl SuzukaPartialNode { - - pub fn new(executor : T, light_node_client: LightNodeServiceClient) -> Self { - let (transaction_sender, transaction_receiver) = async_channel::unbounded(); - Self { - executor : executor, - transaction_sender, - transaction_receiver, - light_node_client : Arc::new(RwLock::new(light_node_client)), - } - } +impl SuzukaPartialNode +where + T: SuzukaExecutor + Send + Sync, +{ + pub fn new( + executor: T, + light_node_client: LightNodeServiceClient, + settlement_client: C, + ) -> (Self, impl Future> + Send) + where + C: McrSettlementClientOperations + Send + 'static, + { + let (settlement_manager, commitment_events) = McrSettlementManager::new(settlement_client); + let (transaction_sender, transaction_receiver) = async_channel::unbounded(); + ( + Self { + executor, + transaction_sender, + transaction_receiver, + light_node_client: Arc::new(RwLock::new(light_node_client)), + settlement_manager, + }, + read_commitment_events(commitment_events), + ) + } fn bind_transaction_channel(&mut self) { self.executor.set_tx_channel(self.transaction_sender.clone()); } - pub fn bound( + pub fn bound( executor: T, light_node_client: LightNodeServiceClient, - ) -> Result { - let mut node = Self::new(executor, light_node_client); + settlement_client: C, + ) -> Result<(Self, impl Future> + Send), anyhow::Error> + where + C: McrSettlementClientOperations + Send + 'static, + { + let (mut node, background_task) = Self::new(executor, light_node_client, settlement_client); node.bind_transaction_channel(); - Ok(node) + Ok((node, background_task)) } pub async fn tick_write_transactions_to_da(&self) -> Result<(), anyhow::Error> { @@ -67,7 +88,9 @@ impl SuzukaPartialNode { match transaction_result { Ok(transaction) => { - println!("Got transaction: {:?}", transaction); + + debug!("Got transaction: {:?}", transaction); + let serialized_transaction = serde_json::to_vec(&transaction)?; transactions.push(BlobWrite { data: serialized_transaction @@ -91,7 +114,9 @@ impl SuzukaPartialNode { blobs: transactions } ).await?; - println!("Wrote transactions to DA"); + + debug!("Wrote transactions to DA"); + } Ok(()) @@ -110,9 +135,9 @@ impl SuzukaPartialNode { // receive transactions from the transaction channel and send them to be executed // ! This assumes the m1 da light node is running sequencer mode pub async fn read_blocks_from_da(&self) -> Result<(), anyhow::Error> { - + let block_head_height = self.executor.get_block_head_height().await?; - + let mut stream = { let client_ptr = self.light_node_client.clone(); let mut light_node_client = client_ptr.write().await; @@ -123,111 +148,122 @@ impl SuzukaPartialNode { ).await? }.into_inner(); - while let Some(blob) = stream.next().await { + while let Some(blob) = stream.next().await { + + debug!("Got blob: {:?}", blob); - println!("Stream hot!"); // get the block - let block_bytes = match blob?.blob.ok_or(anyhow::anyhow!("No blob in response"))?.blob_type.ok_or(anyhow::anyhow!("No blob type in response"))? { + let (block_bytes, block_timestamp, block_id) = match blob?.blob.ok_or(anyhow::anyhow!("No blob in response"))?.blob_type.ok_or(anyhow::anyhow!("No blob type in response"))? { blob_response::BlobType::SequencedBlobBlock(blob) => { - blob.data + (blob.data, blob.timestamp, blob.blob_id) }, _ => { anyhow::bail!("Invalid blob type in response") } }; - // get the block - let block : Block = serde_json::from_slice(&block_bytes)?; - println!("Received block: {:?}", block); - - // get the transactions - let mut block_transactions = Vec::new(); - for transaction in block.transactions { - let signed_transaction : SignedTransaction = serde_json::from_slice(&transaction.0)?; - let signature_verified_transaction = SignatureVerifiedTransaction::Valid( - Transaction::UserTransaction( - signed_transaction - ) - ); - block_transactions.push(signature_verified_transaction); - } - - // form the executable transactions vec - let block = ExecutableTransactions::Unsharded( - block_transactions - ); + let block : Block = serde_json::from_slice(&block_bytes)?; - // hash the block bytes - let mut hasher = sha2::Sha256::new(); - hasher.update(&block_bytes); - let slice = hasher.finalize(); - let block_hash = HashValue::from_slice(slice.as_slice())?; - - // form the executable block and execute it - let executable_block = ExecutableBlock::new( - block_hash, - block - ); - let block_id = executable_block.block_id; - self.executor.execute_block( - FinalityMode::Opt, - executable_block - ).await?; - - println!("Executed block: {:?}", block_id); - - } - - Ok(()) - - } - + debug!("Got block: {:?}", block); + + // get the transactions + let mut block_transactions = Vec::new(); + let block_metadata = self.executor.build_block_metadata( + HashValue::sha3_256_of(block_id.as_bytes()), + block_timestamp + ).await?; + let block_metadata_transaction = SignatureVerifiedTransaction::Valid( + Transaction::BlockMetadata( + block_metadata + ) + ); + block_transactions.push(block_metadata_transaction); + + for transaction in block.transactions { + let signed_transaction : SignedTransaction = serde_json::from_slice(&transaction.0)?; + let signature_verified_transaction = SignatureVerifiedTransaction::Valid( + Transaction::UserTransaction( + signed_transaction + ) + ); + block_transactions.push(signature_verified_transaction); + } + + // form the executable transactions vec + let block = ExecutableTransactions::Unsharded(block_transactions); + + // hash the block bytes + let mut hasher = sha2::Sha256::new(); + hasher.update(&block_bytes); + let slice = hasher.finalize(); + let block_hash = HashValue::from_slice(slice.as_slice())?; + + // form the executable block and execute it + let executable_block = ExecutableBlock::new(block_hash, block); + let block_id = executable_block.block_id; + let commitment = + self.executor.execute_block(FinalityMode::Opt, executable_block).await?; + + debug!("Executed block: {:?}", block_id); + + self.settlement_manager.post_block_commitment(commitment).await?; + } + + Ok(()) + } } -impl SuzukaFullNode for SuzukaPartialNode { - - /// Runs the services until crash or shutdown. - async fn run_services(&self) -> Result<(), anyhow::Error> { - - self.executor.run_service().await?; - - Ok(()) - - } - - /// Runs the background tasks until crash or shutdown. - async fn run_background_tasks(&self) -> Result<(), anyhow::Error> { - - self.executor.run_background_tasks().await?; +async fn read_commitment_events(mut stream: CommitmentEventStream) -> anyhow::Result<()> { + while let Some(res) = stream.next().await { + let event = res?; + match event { + BlockCommitmentEvent::Accepted(commitment) => { + debug!("Commitment accepted: {:?}", commitment); + }, + BlockCommitmentEvent::Rejected { height, reason } => { + debug!("Commitment rejected: {:?} {:?}", height, reason); + }, + } + } + Ok(()) +} - Ok(()) +impl SuzukaFullNode for SuzukaPartialNode +where + T: SuzukaExecutor + Send + Sync, +{ + /// Runs the services until crash or shutdown. + async fn run_services(&self) -> Result<(), anyhow::Error> { + self.executor.run_service().await?; - } - - // ! Currently this only implements opt. - /// Runs the executor until crash or shutdown. - async fn run_executor(&self) -> Result<(), anyhow::Error> { + Ok(()) + } - // wait for both tasks to finish - tokio::try_join!( - self.write_transactions_to_da(), - self.read_blocks_from_da() - )?; + /// Runs the background tasks until crash or shutdown. + async fn run_background_tasks(&self) -> Result<(), anyhow::Error> { + self.executor.run_background_tasks().await?; - Ok(()) - + Ok(()) + } - } + // ! Currently this only implements opt. + /// Runs the executor until crash or shutdown. + async fn run_executor(&self) -> Result<(), anyhow::Error> { + // wait for both tasks to finish + tokio::try_join!(self.write_transactions_to_da(), self.read_blocks_from_da())?; + Ok(()) + } } impl SuzukaPartialNode { - - pub async fn try_from_env() -> Result { - let (tx, _) = async_channel::unbounded(); - let light_node_client = LightNodeServiceClient::connect("http://[::1]:30730").await?; - let executor = SuzukaExecutorV1::try_from_env(tx).await.context( - "Failed to get executor from environment" - )?; - Self::bound(executor, light_node_client) - } - -} \ No newline at end of file + pub async fn try_from_env( + ) -> Result<(Self, impl Future> + Send), anyhow::Error> { + let (tx, _) = async_channel::unbounded(); + let light_node_client = LightNodeServiceClient::connect("http://0.0.0.0:30730").await?; + let executor = SuzukaExecutorV1::try_from_env(tx) + .await + .context("Failed to get executor from environment")?; + // TODO: switch to real settlement client + let settlement_client = MockMcrSettlementClient::new(); + Self::bound(executor, light_node_client, settlement_client) + } +} diff --git a/nix/m1-da-light-node.nix b/nix/m1-da-light-node.nix new file mode 100644 index 000000000..70663319b --- /dev/null +++ b/nix/m1-da-light-node.nix @@ -0,0 +1,71 @@ +{ pkgs, frameworks, RUSTFLAGS }: + +pkgs.rustPlatform.buildRustPackage rec { + pname = "m1-da-light-node"; + version = "0.1.0"; + + buildInput = with pkgs; [ + llvmPackages.bintools + openssl + openssl.dev + libiconv + pkg-config + process-compose + just + jq + libclang.lib + libz + clang + pkg-config + protobuf + rustPlatform.bindgenHook + lld + coreutils + gcc + ] ++ lib.optionals stdenv.isDarwin [ + frameworks.Security + frameworks.CoreServices + frameworks.SystemConfiguration + frameworks.AppKit + ] ++ lib.optionals stdenv.isLinux [ + udev + systemd + ]; + + src = ./..; + + cargoSha256 = pkgs.lib.fakeSha256; + + # several of these + buildPhase = '' + export HOME=$(mktemp -d) + export RUSTFLAGS="${RUSTFLAGS}" + cargo clean + cargo build --release -p monza-full-node + ''; + + ## buildAndTestSubdir = "protocol-units/da/m1/light-node"; + + cargoLock = { + lockFile = ../Cargo.lock; + outputHashes = { + "abstract-domain-derive-0.1.0" = "sha256-53ObE7yoEMuZWjIAXXAm4hDBBKU1VhgEj/Zc9EQ4MBA="; + "bcs-0.1.4" = "sha256-SzODBDLSQRXExjke0/7FN/wQQq3vxcwFeGOa37H3Gtg="; + "celestia-proto-0.2.0" = "sha256-/GucnpYoCqQ0plcDTwuUoZxC3rLsNnso1LVTg+tY4+k="; + "merlin-3.0.0" = "sha256-JATfmaS1EA33gcGJFNzUEZM1pBKh22q0jubA2dtLS1I="; + "poseidon-ark-0.0.1" = "sha256-xDff0iC/OOzrb3fEycfmb0Rb/omCuVjNoibDOrr/32A="; + "serde-generate-0.20.6" = "sha256-Oa9inyiTPQv1ScSQog+Ry+c7aLnAx4GcGn5ravGPthM="; + "sha2-0.10.8" = "sha256-vuFQFlbDXEW+n9+Nx2VeWanggCSd6NZ+GVEDFS9qZ2M="; + "x25519-dalek-1.2.0" = "sha256-AHjhccCqacu0WMTFyxIret7ghJ2V+8wEAwR5L6Hy1KY="; + "zstd-sys-2.0.9+zstd.1.5.5" = "sha256-n7abNAHEfDeRSjhh7SpI/BpkJCVLONJwKvaXwVB4PXs="; + }; + }; + + meta = with pkgs.lib; { + description = "M1 DA Light Node"; + homepage = "https://github.com/movementlabsxyz/movement"; + license = licenses.mit; + maintainers = [ maintainers.your_name ]; + }; + +} diff --git a/process-compose/m1-da-light-node/process-compose.yml b/process-compose/m1-da-light-node/process-compose.yml index 6074363e3..5e00d4ce3 100644 --- a/process-compose/m1-da-light-node/process-compose.yml +++ b/process-compose/m1-da-light-node/process-compose.yml @@ -20,7 +20,7 @@ processes: m1-da-light-node: command: | - ./target/debug/m1-da-light-node + ./target/$CARGO_PROFILE/m1-da-light-node depends_on: m1-da-light-node-verifier-tests: condition: process_completed_successfully diff --git a/process-compose/monza-full-node/process-compose.test.yml b/process-compose/monza-full-node/process-compose.test.yml index 0a999c978..24b42ca8f 100644 --- a/process-compose/monza-full-node/process-compose.test.yml +++ b/process-compose/monza-full-node/process-compose.test.yml @@ -6,7 +6,6 @@ processes: monza-client-tests: command: | - # FIXME(nix-ci-fix): this is the latest we can push linking issues, here and in the Monza faucet process we will get a libssl linking issue cargo test -p monza-client -- --test-threads=1 depends_on: monza-full-node: diff --git a/process-compose/monza-full-node/process-compose.yml b/process-compose/monza-full-node/process-compose.yml index 8e47b976a..f8bbf4aab 100644 --- a/process-compose/monza-full-node/process-compose.yml +++ b/process-compose/monza-full-node/process-compose.yml @@ -17,8 +17,7 @@ processes: m1-da-light-node: command: | - # FIXME(nix-ci-fix): when we modify LD_PATH directly, we get a missing libstdc++ here - ./target/debug/m1-da-light-node + ./target/$CARGO_PROFILE/m1-da-light-node depends_on: celestia-light-node-synced: condition: process_completed_successfully @@ -33,7 +32,7 @@ processes: monza-full-node: command: | - ./target/debug/monza-full-node + ./target/$CARGO_PROFILE/monza-full-node depends_on: m1-da-light-node: condition: process_healthy @@ -45,7 +44,6 @@ processes: monza-faucet: command : | - # FIXME(nix-ci-fix): this is the latest we can push linking issues, here and in the Monza client tests we will get a libssl linking issue ./scripts/monza/faucet depends_on: monza-full-node: diff --git a/process-compose/suzuka-full-node/process-compose.local.yml b/process-compose/suzuka-full-node/process-compose.local.yml new file mode 100644 index 000000000..f68eb73e6 --- /dev/null +++ b/process-compose/suzuka-full-node/process-compose.local.yml @@ -0,0 +1,52 @@ +version: "3" + +environment: + +processes: + + celestia-node-appd: + command: | + ./scripts/celestia/celestia-local-appd + readiness_probe: + initial_delay_seconds: 10 + exec: + command: echo "true" + liveness_probe: + initial_delay_seconds: 10 + exec: + command: echo "true" + + celestia-bridge: + command: | + ./scripts/celestia/celestia-local-bridge + readiness_probe: + initial_delay_seconds: 10 + exec: + command: echo "true" + liveness_probe: + initial_delay_seconds: 10 + exec: + command: echo "true" + depends_on: + celestia-node-appd: + condition: process_healthy + + celestia-light-node: + command: | + sleep 999999999d + echo "started" + readiness_probe: + initial_delay_seconds: 10 + exec: + command: | + echo "true" + liveness_probe: + initial_delay_seconds: 10 + exec: + command: | + echo "true" + depends_on: + celestia-node-appd: + condition: process_healthy + celestia-bridge: + condition: process_healthy \ No newline at end of file diff --git a/process-compose/suzuka-full-node/process-compose.test.yml b/process-compose/suzuka-full-node/process-compose.test.yml new file mode 100644 index 000000000..a153b151a --- /dev/null +++ b/process-compose/suzuka-full-node/process-compose.test.yml @@ -0,0 +1,16 @@ +version: "3" + +environment: + +processes: + + suzuka-client-tests: + command: | + cargo test -p suzuka-client -- --test-threads=1 + depends_on: + suzuka-full-node: + condition: process_healthy + suzuka-faucet: + condition: process_healthy + availability: + exit_on_end: true \ No newline at end of file diff --git a/process-compose/suzuka-full-node/process-compose.yml b/process-compose/suzuka-full-node/process-compose.yml new file mode 100644 index 000000000..cc403a707 --- /dev/null +++ b/process-compose/suzuka-full-node/process-compose.yml @@ -0,0 +1,55 @@ +version: "3" + +environment: + +processes: + + celestia-light-node: + command: | + exit 1 + + celestia-light-node-synced: + command: | + cargo run --bin wait-for-celestia-light-node + depends_on: + celestia-light-node: + condition: process_healthy + + m1-da-light-node: + command: | + ./target/$CARGO_PROFILE/m1-da-light-node + depends_on: + celestia-light-node-synced: + condition: process_completed_successfully + readiness_probe: + initial_delay_seconds: 10 + exec: + command: echo "true" + liveness_probe: + initial_delay_seconds: 10 + exec: + command: echo "true" + + suzuka-full-node: + command: | + ./target/$CARGO_PROFILE/suzuka-full-node + depends_on: + m1-da-light-node: + condition: process_healthy + readiness_probe: + initial_delay_seconds: 10 + exec: + command: | + echo "true" + + suzuka-faucet: + command : | + ./scripts/suzuka/faucet + depends_on: + suzuka-full-node: + condition: process_healthy + readiness_probe: + initial_delay_seconds: 10 + exec: + command: echo "true" + diff --git a/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto b/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto index 122ffa4f0..759253046 100644 --- a/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto +++ b/proto/movementlabs/protocol_units/da/m1/light_node/v1beta1.proto @@ -8,6 +8,7 @@ message Blob { bytes data = 2; uint64 height = 3; // bytes signature = 4; // at some point a signature will be added here + uint64 timestamp = 5; } enum VerificationMode { diff --git a/protocol-units/da/m1/light-node-client/src/test/e2e/raw/passthrough.rs b/protocol-units/da/m1/light-node-client/src/test/e2e/raw/passthrough.rs index 92687bc4e..1ec82f88f 100644 --- a/protocol-units/da/m1/light-node-client/src/test/e2e/raw/passthrough.rs +++ b/protocol-units/da/m1/light-node-client/src/test/e2e/raw/passthrough.rs @@ -6,7 +6,7 @@ use tokio_stream::StreamExt; #[tokio::test] async fn test_light_node_submits_blob_over_stream() -> Result<(), anyhow::Error>{ - let mut client = LightNodeServiceClient::connect("http://[::1]:30730").await?; + let mut client = LightNodeServiceClient::connect("http://0.0.0.0:30730").await?; let blob_write = BlobWrite { data : vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9] @@ -54,7 +54,7 @@ async fn test_light_node_submits_blob_over_stream() -> Result<(), anyhow::Error> #[tokio::test] async fn test_submit_and_read() -> Result<(), anyhow::Error>{ - let mut client = LightNodeServiceClient::connect("http://[::1]:30730").await?; + let mut client = LightNodeServiceClient::connect("http://0.0.0.0:30730").await?; let data = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; let blob_write = BlobWrite { diff --git a/protocol-units/da/m1/light-node-client/src/test/e2e/raw/sequencer.rs b/protocol-units/da/m1/light-node-client/src/test/e2e/raw/sequencer.rs index 02d568559..8497c7e1c 100644 --- a/protocol-units/da/m1/light-node-client/src/test/e2e/raw/sequencer.rs +++ b/protocol-units/da/m1/light-node-client/src/test/e2e/raw/sequencer.rs @@ -5,7 +5,7 @@ use movement_types::Block; #[tokio::test] async fn test_light_node_submits_blob_over_stream() -> Result<(), anyhow::Error>{ - let mut client = LightNodeServiceClient::connect("http://[::1]:30730").await?; + let mut client = LightNodeServiceClient::connect("http://0.0.0.0:30730").await?; let data = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; let blob_write = BlobWrite { diff --git a/protocol-units/da/m1/light-node/Cargo.toml b/protocol-units/da/m1/light-node/Cargo.toml index 8c567950e..093a35378 100644 --- a/protocol-units/da/m1/light-node/Cargo.toml +++ b/protocol-units/da/m1/light-node/Cargo.toml @@ -29,13 +29,13 @@ async-stream = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } tempfile = { workspace = true } +tracing = { workspace = true } +chrono = { workspace = true } # sequencer memseq = { workspace = true, optional = true } -env_logger = { workspace = true, optional = true } -tracing = { workspace = true, optional = true } tracing-subscriber = { workspace = true, optional = true } [features] @@ -44,8 +44,6 @@ default = [ "logging" ] logging = [ - "env_logger", - "tracing", "tracing-subscriber" ] sequencer = [ diff --git a/protocol-units/da/m1/light-node/src/main.rs b/protocol-units/da/m1/light-node/src/main.rs index e7a9fe43c..cc26d4e8a 100644 --- a/protocol-units/da/m1/light-node/src/main.rs +++ b/protocol-units/da/m1/light-node/src/main.rs @@ -6,6 +6,8 @@ use m1_da_light_node::v1::{ #[tokio::main] async fn main() -> Result<(), Box> { + // TODO: set up tracing-subscriber if the "logging" feature is enabled + let light_node = LightNodeV1::try_from_env().await?; light_node.run().await?; diff --git a/protocol-units/da/m1/light-node/src/v1/mod.rs b/protocol-units/da/m1/light-node/src/v1/mod.rs index 6cba1419a..506d55af1 100644 --- a/protocol-units/da/m1/light-node/src/v1/mod.rs +++ b/protocol-units/da/m1/light-node/src/v1/mod.rs @@ -34,7 +34,7 @@ pub trait LightNodeV1Operations : LightNodeService + Send + Sync + Sized + Clone .register_encoded_file_descriptor_set(m1_da_light_node_grpc::FILE_DESCRIPTOR_SET) .build()?; - let env_addr = std::env::var("M1_DA_LIGHT_NODE_ADDR").unwrap_or_else(|_| "[::1]:30730".to_string()); + let env_addr = std::env::var("M1_DA_LIGHT_NODE_ADDR").unwrap_or_else(|_| "0.0.0.0:30730".to_string()); let addr = env_addr.parse()?; Server::builder() diff --git a/protocol-units/da/m1/light-node/src/v1/passthrough.rs b/protocol-units/da/m1/light-node/src/v1/passthrough.rs index 3f698402f..c33117541 100644 --- a/protocol-units/da/m1/light-node/src/v1/passthrough.rs +++ b/protocol-units/da/m1/light-node/src/v1/passthrough.rs @@ -1,15 +1,21 @@ -use m1_da_light_node_grpc::{blob_response, light_node_service_server::LightNodeService}; -use m1_da_light_node_grpc::*; +use std::sync::Arc; + use tokio_stream::{StreamExt, Stream}; +use tokio::sync::RwLock; +use tracing::debug; + use celestia_rpc::{BlobClient, Client, HeaderClient}; use celestia_types::{blob::GasPrice, nmt::Namespace, Blob as CelestiaBlob}; -use std::sync::Arc; -use tokio::sync::RwLock; + +// FIXME: glob imports are bad style +use m1_da_light_node_grpc::*; +use m1_da_light_node_grpc::light_node_service_server::LightNodeService; use m1_da_light_node_util::Config; use m1_da_light_node_verifier::{ Verifier, v1::V1Verifier }; + use crate::v1::LightNodeV1Operations; @@ -91,8 +97,8 @@ impl LightNodeV1 { .blob_get_all(height, &[self.celestia_namespace]) .await; - if blobs.is_err() { - println!("Error getting blobs: {:?}", blobs.as_ref().err().unwrap()); + if let Err(e) = &blobs { + debug!("Error getting blobs: {:?}", e); } let blobs = blobs.unwrap_or_default(); @@ -100,7 +106,7 @@ impl LightNodeV1 { let mut verified_blobs = Vec::new(); for blob in blobs { - println!("Verifying blob"); + debug!("Verifying blob"); let blob_data = blob.data.clone(); @@ -111,10 +117,14 @@ impl LightNodeV1 { height, ).await; - if verified.is_err() { - println!("Error verifying blob: {:?}", verified.as_ref().err().unwrap()); + if let Err(e) = &verified { + debug!("Error verifying blob: {:?}", e); } + // FIXME: check the implications of treating errors as verification success. + // @l-monninger: under the assumption we are running a light node in the same + // trusted setup and have not experience a highly intrusive(?), the vulnerability here + // is fairly low. The light node should take care of verification on its own. let verified = verified.unwrap_or(true); if verified { @@ -172,7 +182,8 @@ impl LightNodeV1 { let header = header_res?; let height = header.height().into(); - println!("Stream got header: {:?}", header.height()); + + debug!("Stream got header: {:?}", header.height()); // back fetch the blobs if first_flag && (height > start_height) { @@ -180,7 +191,9 @@ impl LightNodeV1 { let mut blob_stream = me.stream_blobs_in_range(start_height, Some(height)).await?; while let Some(blob) = blob_stream.next().await { - println!("Stream got blob: {:?}", blob); + + debug!("Stream got blob: {:?}", blob); + yield blob?; } @@ -189,7 +202,9 @@ impl LightNodeV1 { let blobs = me.get_blobs_at_height(height).await?; for blob in blobs { - println!("Stream got blob: {:?}", blob); + + debug!("Stream got blob: {:?}", blob); + yield blob; } } @@ -199,12 +214,16 @@ impl LightNodeV1 { } pub fn celestia_blob_to_blob(blob: CelestiaBlob, height: u64) -> Result { + + let timestamp = chrono::Utc::now().timestamp() as u64; + Ok(Blob { data: blob.data, blob_id: serde_json::to_string(&blob.commitment).map_err( |e| anyhow::anyhow!("Failed to serialize commitment: {}", e) )?, - height + height, + timestamp, }) } diff --git a/protocol-units/da/m1/light-node/src/v1/sequencer.rs b/protocol-units/da/m1/light-node/src/v1/sequencer.rs index ce9e9dffd..e2485cab8 100644 --- a/protocol-units/da/m1/light-node/src/v1/sequencer.rs +++ b/protocol-units/da/m1/light-node/src/v1/sequencer.rs @@ -1,12 +1,17 @@ +use tokio_stream::Stream; +use tracing::{info, debug}; + use celestia_rpc::HeaderClient; + use m1_da_light_node_grpc::light_node_service_server::LightNodeService; +// FIXME: glob imports are bad style use m1_da_light_node_grpc::*; -use tokio_stream::Stream; +use memseq::{Transaction, Sequencer}; + use crate::v1::{ LightNodeV1Operations, passthrough::LightNodeV1 as LightNodeV1PassThrough }; -use memseq::{Transaction, Sequencer}; #[derive(Clone)] pub struct LightNodeV1 { @@ -18,24 +23,13 @@ impl LightNodeV1Operations for LightNodeV1 { async fn try_from_env() -> Result { - #[cfg(feature = "logging")] - { - - tracing::info!("Initializing LightNodeV1 in sequencer mode from environment."); - - } + info!("Initializing LightNodeV1 in sequencer mode from environment."); let pass_through = LightNodeV1PassThrough::try_from_env().await?; - #[cfg(feature = "logging")] - { - tracing::info!("Initialized pass through for LightNodeV1 in sequencer mode."); - } + info!("Initialized pass through for LightNodeV1 in sequencer mode."); let memseq = memseq::Memseq::try_move_rocks_from_env()?; - #[cfg(feature = "logging")] - { - tracing::info!("Initialized Memseq with Move Rocks for LightNodeV1 in sequencer mode."); - } + info!("Initialized Memseq with Move Rocks for LightNodeV1 in sequencer mode."); Ok(Self { pass_through, @@ -69,7 +63,9 @@ impl LightNodeV1 { )?; let height = self.pass_through.submit_celestia_blob(block_blob).await?; - println!("Submitted block: {:?} {:?}", block.id(), height); + + debug!("Submitted block: {:?} {:?}", block.id(), height); + }, None => { // no transactions to include @@ -118,7 +114,8 @@ impl LightNodeV1 { Blob { data, blob_id : "".to_string(), - height + height, + timestamp : 0, } )) }) @@ -226,7 +223,9 @@ impl LightNodeService for LightNodeV1 { // publish the transactions for transaction in transactions { - println!("Publishing transaction: {:?}", transaction.id()); + + debug!("Publishing transaction: {:?}", transaction.id()); + self.memseq.publish(transaction).await.map_err( |e| tonic::Status::internal(e.to_string()) )?; diff --git a/protocol-units/execution/maptos/opt-executor/Cargo.toml b/protocol-units/execution/maptos/opt-executor/Cargo.toml index 40afd1406..bb1ca55b3 100644 --- a/protocol-units/execution/maptos/opt-executor/Cargo.toml +++ b/protocol-units/execution/maptos/opt-executor/Cargo.toml @@ -30,9 +30,12 @@ poem-openapi = { workspace = true } derive_more = { workspace = true, default-features = true } lazy_static = "1.4.0" tokio = { workspace = true } +tracing = { workspace = true } rand = { workspace = true } rand_core = { workspace = true } bcs = { workspace = true} +futures = { workspace = true } +async-channel = { workspace = true } aptos-vm = { workspace = true } aptos-config = { workspace = true } @@ -58,17 +61,14 @@ aptos-mempool = { workspace = true } aptos-temppath = { workspace = true } aptos-faucet-core = { workspace = true } aptos-cached-packages = { workspace = true } -futures = { workspace = true } -async-channel = { workspace = true } maptos-execution-util = { workspace = true } +movement-types = { workspace = true } dirs = { workspace = true } tempfile = { workspace = true } async-trait = { workspace = true } # optional logging dependencies -env_logger = { workspace = true, optional = true } -tracing = { workspace = true, optional = true } tracing-subscriber = { workspace = true, optional = true } [features] @@ -76,7 +76,5 @@ default = [ "logging" ] logging = [ - "env_logger", - "tracing", "tracing-subscriber" ] \ No newline at end of file diff --git a/protocol-units/execution/maptos/opt-executor/src/executor.rs b/protocol-units/execution/maptos/opt-executor/src/executor.rs index d60126e8a..34a470a04 100644 --- a/protocol-units/execution/maptos/opt-executor/src/executor.rs +++ b/protocol-units/execution/maptos/opt-executor/src/executor.rs @@ -1,45 +1,51 @@ -use anyhow::Context as _; +use aptos_api::{ + get_api_service, + runtime::{get_apis, Apis}, + Context, +}; +use aptos_config::config::NodeConfig; +use aptos_crypto::{ed25519::Ed25519PublicKey, HashValue}; use aptos_db::AptosDB; +use aptos_executor::{ + block_executor::BlockExecutor, + db_bootstrapper::{generate_waypoint, maybe_bootstrap}, +}; use aptos_executor_types::BlockExecutorTrait; +use aptos_mempool::SubmissionStatus; use aptos_mempool::{ core_mempool::{CoreMempool, TimelineState}, MempoolClientRequest, MempoolClientSender, }; +use aptos_sdk::types::mempool_status::{MempoolStatus, MempoolStatusCode}; +use aptos_sdk::types::on_chain_config::{OnChainConsensusConfig, OnChainExecutionConfig}; use aptos_storage_interface::DbReaderWriter; use aptos_types::{ - block_executor::{config::BlockExecutorConfigFromOnchain, partitioner::ExecutableBlock}, chain_id::ChainId, transaction::{ - ChangeSet, SignedTransaction, Transaction, WriteSetPayload - }, validator_signer::ValidatorSigner + aggregate_signature::AggregateSignature, + block_info::BlockInfo, + ledger_info::{LedgerInfo, LedgerInfoWithSignatures}, + transaction::Version, + block_executor::partitioner::ExecutableTransactions, +}; +use aptos_types::{ + block_executor::{config::BlockExecutorConfigFromOnchain, partitioner::ExecutableBlock}, + chain_id::ChainId, + transaction::{ChangeSet, SignedTransaction, Transaction, WriteSetPayload, signature_verified_transaction::SignatureVerifiedTransaction}, + validator_signer::ValidatorSigner, }; use aptos_vm::AptosVM; -use std::{path::PathBuf, sync::Arc}; -use tokio::sync::RwLock; -use aptos_config::config::NodeConfig; -use aptos_executor::{ - block_executor::BlockExecutor, - db_bootstrapper::{generate_waypoint, maybe_bootstrap}, +use aptos_vm_genesis::{ + default_gas_schedule, encode_genesis_change_set, GenesisConfiguration, TestValidator, Validator, }; -use aptos_api::{get_api_service, runtime::{get_apis, Apis}, Context}; +use movement_types::{Id, Commitment, BlockCommitment}; + +use anyhow::Context as _; use futures::channel::mpsc as futures_mpsc; -use poem::{listener::TcpListener, Route, Server}; -use aptos_sdk::types::mempool_status::{MempoolStatus, MempoolStatusCode}; -use aptos_mempool::SubmissionStatus; use futures::StreamExt; -use aptos_types::{ - aggregate_signature::AggregateSignature, - block_info::BlockInfo, - ledger_info::{LedgerInfo, LedgerInfoWithSignatures}, - transaction::Version -}; -use aptos_crypto::{ - ed25519::{Ed25519PrivateKey, Ed25519PublicKey}, - HashValue -}; -use aptos_vm_genesis::{TestValidator, Validator, encode_genesis_change_set, GenesisConfiguration, default_gas_schedule}; -use aptos_sdk::types::on_chain_config::{ - OnChainConsensusConfig, OnChainExecutionConfig -}; -// use aptos_types::test_helpers::transaction_test_helpers::block; +use poem::{listener::TcpListener, Route, Server}; +use tokio::sync::RwLock; +use tracing::{debug, info}; + +use std::{path::PathBuf, sync::Arc}; /// The `Executor` is responsible for executing blocks and managing the state of the execution /// against the `AptosVM`. @@ -224,36 +230,10 @@ impl Executor { } - pub fn get_ledger_info_with_sigs( - &self, - block_id: HashValue, - root_hash: HashValue, - version: Version, - ) -> LedgerInfoWithSignatures { - let block_info = BlockInfo::new( - 1, - 0, - block_id, - root_hash, version, - 0, /* timestamp_usecs, doesn't matter */ - None, - ); - let ledger_info = LedgerInfo::new( - block_info, - HashValue::zero(), /* consensus_data_hash, doesn't matter */ - ); - LedgerInfoWithSignatures::new( - ledger_info, - AggregateSignature::empty(), /* signatures */ - ) - } - - /// Execute a block which gets committed to the state. - /// `ExecutorState` must be set to `Commit` before calling this method. - pub async fn execute_block( + async fn execute_block_inner( &self, block: ExecutableBlock, - ) -> Result<(), anyhow::Error> { + ) -> Result { let block_id = block.block_id.clone(); let parent_block_id = { @@ -266,30 +246,100 @@ impl Executor { block_executor.execute_block(block, parent_block_id, BlockExecutorConfigFromOnchain::new_no_block_limit())? }; - println!("State compute: {:?}", state_compute); + debug!("State compute: {:?}", state_compute); - let latest_version = { - let reader = self.db.read().await.reader.clone(); - reader.get_latest_version()? - }; + let version = state_compute.version(); + + + let (epoch, round) = self.get_next_epoch_and_round().await?; { - let ledger_info_with_sigs = self.get_ledger_info_with_sigs(block_id, state_compute.root_hash(), state_compute.version()); + let ledger_info_with_sigs = ledger_info_with_sigs( + epoch, + round, + block_id, + state_compute.root_hash(), + version, + ); let block_executor = self.block_executor.write().await; block_executor.commit_blocks( vec![block_id], ledger_info_with_sigs, )?; - } + } + Ok(version) + } - { - let reader = self.db.read().await.reader.clone(); - let proof = reader.get_state_proof( - state_compute.version(), - )?; + /// Execute a block which gets committed to the state. + pub async fn execute_block( + &self, + block: ExecutableBlock, + ) -> Result { + + // todo: this should be deterministic, so let's rehash the block id + let hash_str = format!("{:?}", block.block_id); + let mut hash_bytes = hash_str.as_bytes().to_vec(); + hash_bytes.reverse(); + let metadata_block_id = HashValue::sha3_256_of(&hash_bytes); + + // To correctly update block height, we employ a workaround to execute + // the block metadata transaction in its own block first. + + // pop 0th transaction + let transactions = block.transactions; + let mut transactions = match transactions { + ExecutableTransactions::Unsharded(transactions) => transactions, + _ => anyhow::bail!("Only unsharded transactions are supported"), + }; + if transactions.len() == 0 { + anyhow::bail!("Block must have at least the metadata transaction"); } + let block_metadata = match transactions.remove(0) { + SignatureVerifiedTransaction::Valid(Transaction::BlockMetadata(block_metadata)) => block_metadata, + _ => anyhow::bail!("Block metadata not found") + }; - Ok(()) + // execute the block metadata block + self.execute_block_inner( + ExecutableBlock::new( + metadata_block_id.clone(), + ExecutableTransactions::Unsharded( + vec![SignatureVerifiedTransaction::Valid(Transaction::BlockMetadata(block_metadata))] + ) + ) + ).await?; + + // execute the rest of the block + let version = self.execute_block_inner( + ExecutableBlock::new( + block.block_id.clone(), + ExecutableTransactions::Unsharded( + transactions + ) + ) + ).await?; + + let proof = { + let reader = self.db.read().await.reader.clone(); + reader.get_state_proof(version)? + }; + + // Context has a reach-around to the db so the block height should + // have been updated to the most recently committed block. + // Race conditions, anyone? + let block_height = self.get_block_head_height()?; + + let commitment = Commitment::digest_state_proof(&proof); + Ok(BlockCommitment { + block_id: Id(block.block_id.to_vec()), + commitment, + height: block_height.into(), + }) + } + + pub fn get_block_head_height(&self) -> Result { + let ledger_info = self.context.get_latest_ledger_info_wrapped()?; + Ok(ledger_info.block_height.into()) } fn context(&self) -> Arc { @@ -302,15 +352,10 @@ impl Executor { pub async fn run_service(&self) -> Result<(), anyhow::Error> { - #[cfg(feature = "logging")] - { - // log out to tracing - tracing::info!( - "Starting maptos-opt-executor services at: {:?}", - self.aptos_config.aptos_rest_listen_url - ); - - } + info!( + "Starting maptos-opt-executor services at: {:?}", + self.aptos_config.aptos_rest_listen_url + ); let api_service = get_api_service(self.context()).server( format!("http://{:?}", self.aptos_config.aptos_rest_listen_url) @@ -429,6 +474,13 @@ impl Executor { Ok(()) } + pub async fn get_next_epoch_and_round(&self) -> Result<(u64, u64), anyhow::Error> { + let db = self.db.read().await; + let epoch = db.reader.get_latest_ledger_info()?.ledger_info().next_block_epoch(); + let round = db.reader.get_latest_ledger_info()?.ledger_info().round(); + Ok((epoch, round)) + } + /// Pipes a batch of transactions from the mempool to the transaction channel. /// todo: it may be wise to move the batching logic up a level to the consuming structs. pub async fn tick_transaction_pipe( @@ -445,6 +497,32 @@ impl Executor { } +fn ledger_info_with_sigs( + epoch : u64, + round : u64, + block_id: HashValue, + root_hash: HashValue, + version: Version, +) -> LedgerInfoWithSignatures { + let block_info = BlockInfo::new( + epoch, + round, + block_id, + root_hash, + version, + 0, /* timestamp_usecs, doesn't matter */ + None, + ); + let ledger_info = LedgerInfo::new( + block_info, + HashValue::zero(), /* consensus_data_hash, doesn't matter */ + ); + LedgerInfoWithSignatures::new( + ledger_info, + AggregateSignature::empty(), /* signatures */ + ) +} + #[cfg(test)] mod tests { @@ -455,7 +533,7 @@ mod tests { ed25519::{Ed25519PrivateKey, Ed25519Signature}, HashValue, PrivateKey, Uniform }; use aptos_types::{ - account_address::AccountAddress, block_executor::partitioner::ExecutableTransactions, block_metadata::BlockMetadata, chain_id::{self, ChainId}, transaction::{ + account_address::AccountAddress, block_executor::partitioner::ExecutableTransactions, block_metadata::BlockMetadata, chain_id::ChainId, transaction::{ signature_verified_transaction::SignatureVerifiedTransaction, RawTransaction, Script, SignedTransaction, Transaction, TransactionPayload } @@ -498,10 +576,22 @@ mod tests { async fn test_execute_block() -> Result<(), anyhow::Error> { let executor = Executor::try_from_env()?; let block_id = HashValue::random(); + let block_metadata = Transaction::BlockMetadata(BlockMetadata::new( + block_id, + 0, + 0, + executor.signer.author(), + vec![], + vec![], + chrono::Utc::now().timestamp_micros() as u64, + )); let tx = SignatureVerifiedTransaction::Valid(Transaction::UserTransaction( create_signed_transaction(0, executor.aptos_config.chain_id.clone()), )); - let txs = ExecutableTransactions::Unsharded(vec![tx]); + let txs = ExecutableTransactions::Unsharded(vec![ + SignatureVerifiedTransaction::Valid(block_metadata), + tx, + ]); let block = ExecutableBlock::new(block_id.clone(), txs); executor.execute_block(block).await?; Ok(()) @@ -529,27 +619,30 @@ mod tests { let tx_factory = TransactionFactory::new(executor.aptos_config.chain_id.clone()); // Loop to simulate the execution of multiple blocks. - for _ in 0..10 { + for i in 0..10 { + + let (epoch, round) = executor.get_next_epoch_and_round().await?; + // Generate a random block ID. let block_id = HashValue::random(); // Clone the signer from the executor for signing the metadata. - // let signer = executor.signer.clone(); + let signer = executor.signer.clone(); // Get the current time in microseconds for the block timestamp. - // let current_time_micros = chrono::Utc::now().timestamp_micros() as u64; + let current_time_micros = chrono::Utc::now().timestamp_micros() as u64; // Create a block metadata transaction. - /*let block_metadata = Transaction::BlockMetadata(BlockMetadata::new( + let block_metadata = Transaction::BlockMetadata(BlockMetadata::new( block_id, - 1, - 0, + epoch, + round, signer.author(), - vec![0], + vec![], vec![], current_time_micros, - ));*/ + )); // Create a state checkpoint transaction using the block ID. - // let state_checkpoint_tx = Transaction::StateCheckpoint(block_id.clone()); + let state_checkpoint_tx = Transaction::StateCheckpoint(block_id.clone()); // Generate a new account for transaction tests. let new_account = LocalAccount::generate(&mut rng); let new_account_address = new_account.address(); @@ -564,19 +657,16 @@ mod tests { // Store the hash of the committed transaction for later verification. let mint_tx_hash = mint_tx.clone().committed_hash(); - // Group all transactions into a single unsharded block for execution. + // Block Metadata let transactions = ExecutableTransactions::Unsharded( into_signature_verified_block(vec![ - // block_metadata, + block_metadata, Transaction::UserTransaction(user_account_creation_tx), Transaction::UserTransaction(mint_tx), - // state_checkpoint_tx, ]) ); - - // Create and execute the block. let block = ExecutableBlock::new(block_id.clone(), transactions); - executor.execute_block(block).await?; + let block_commitment = executor.execute_block(block).await?; // Access the database reader to verify state after execution. let db_reader = executor.db.read().await.reader.clone(); @@ -598,6 +688,12 @@ mod tests { assert!(queried_account_address.is_some()); let account_resource = account_state_view.get_account_resource()?; assert!(account_resource.is_some()); + + // Check the commitment against state proof + let state_proof = db_reader.get_state_proof(latest_version)?; + let expected_commitment = Commitment::digest_state_proof(&state_proof); + assert_eq!(block_commitment.height, i + 1); + assert_eq!(block_commitment.commitment, expected_commitment); } Ok(()) @@ -625,11 +721,30 @@ mod tests { // Simulate the execution of multiple blocks. for _ in 0..10 { // For example, create and execute 3 blocks. + let (epoch, round) = executor.get_next_epoch_and_round().await?; + let block_id = HashValue::random(); // Generate a random block ID for each block. - + + // Clone the signer from the executor for signing the metadata. + let signer = executor.signer.clone(); + // Get the current time in microseconds for the block timestamp. + let current_time_micros = chrono::Utc::now().timestamp_micros() as u64; + + // Create a block metadata transaction. + let block_metadata = Transaction::BlockMetadata(BlockMetadata::new( + block_id, + epoch, + round, + signer.author(), + vec![], + vec![], + current_time_micros, + )); + // Generate new accounts and create transactions for each block. let mut transactions = Vec::new(); let mut transaction_hashes = Vec::new(); + transactions.push(block_metadata.clone()); for _ in 0..2 { // Each block will contain 2 transactions. let new_account = LocalAccount::generate(&mut rng); let user_account_creation_tx = root_account diff --git a/protocol-units/execution/monza/executor/Cargo.toml b/protocol-units/execution/monza/executor/Cargo.toml index c67d12f0b..bce354d38 100644 --- a/protocol-units/execution/monza/executor/Cargo.toml +++ b/protocol-units/execution/monza/executor/Cargo.toml @@ -63,6 +63,7 @@ aptos-proptest-helpers = { workspace = true } maptos-opt-executor = { workspace = true } maptos-execution-util = { workspace = true } +movement-types = { workspace = true } dirs = "5.0.1" tempfile = "3.10.1" diff --git a/protocol-units/execution/monza/executor/src/lib.rs b/protocol-units/execution/monza/executor/src/lib.rs index 2651799d3..bbf2bedf5 100644 --- a/protocol-units/execution/monza/executor/src/lib.rs +++ b/protocol-units/execution/monza/executor/src/lib.rs @@ -4,13 +4,16 @@ pub use aptos_types::{ transaction::signature_verified_transaction::SignatureVerifiedTransaction, block_executor::partitioner::ExecutableBlock, block_executor::partitioner::ExecutableTransactions, - transaction::{SignedTransaction, Transaction} + transaction::{SignedTransaction, Transaction}, + block_metadata::BlockMetadata, }; pub use aptos_crypto::hash::HashValue; -use async_channel::Sender; -use aptos_api::runtime::Apis; +pub use aptos_api::runtime::Apis; + pub use maptos_execution_util::FinalityMode; +pub use movement_types::BlockCommitment; +use async_channel::Sender; #[tonic::async_trait] pub trait MonzaExecutor { @@ -26,7 +29,7 @@ pub trait MonzaExecutor { &self, mode: FinalityMode, block: ExecutableBlock, - ) -> Result<(), anyhow::Error>; + ) -> Result; /// Sets the transaction channel. fn set_tx_channel( @@ -39,5 +42,8 @@ pub trait MonzaExecutor { /// Get block head height. async fn get_block_head_height(&self) -> Result; + + /// Build block metadata for a timestamp + async fn build_block_metadata(&self, block_id : HashValue, timestamp: u64) -> Result; } diff --git a/protocol-units/execution/monza/executor/src/v1.rs b/protocol-units/execution/monza/executor/src/v1.rs index 63210b81c..07bf5f4a1 100644 --- a/protocol-units/execution/monza/executor/src/v1.rs +++ b/protocol-units/execution/monza/executor/src/v1.rs @@ -1,7 +1,11 @@ +// FIXME: glob imports are bad style use crate::*; use aptos_types::transaction::SignedTransaction; -use async_channel::Sender; use maptos_opt_executor::Executor; +use movement_types::BlockCommitment; + +use async_channel::Sender; +use tracing::debug; #[derive(Clone)] pub struct MonzaExecutorV1 { @@ -45,11 +49,11 @@ impl MonzaExecutor for MonzaExecutorV1 { &self, mode: FinalityMode, block: ExecutableBlock, - ) -> Result<(), anyhow::Error> { + ) -> Result { match mode { FinalityMode::Dyn => unimplemented!(), FinalityMode::Opt => { - println!("Executing opt block: {:?}", block.block_id); + debug!("Executing opt block: {:?}", block.block_id); self.executor.execute_block(block).await }, FinalityMode::Fin => unimplemented!(), @@ -75,8 +79,27 @@ impl MonzaExecutor for MonzaExecutorV1 { /// Get block head height. async fn get_block_head_height(&self) -> Result { - // ideally, this should read from the ledger - Ok(1) + self.executor.get_block_head_height() + } + + /// Build block metadata for a timestamp + async fn build_block_metadata(&self, block_id : HashValue, timestamp: u64) -> Result { + + let (epoch, round) = self.executor.get_next_epoch_and_round().await?; + // Clone the signer from the executor for signing the metadata. + let signer = self.executor.signer.clone(); + + // Create a block metadata transaction. + Ok(BlockMetadata::new( + block_id, + epoch, + round, + signer.author(), + vec![], + vec![], + timestamp, + )) + } } diff --git a/protocol-units/execution/suzuka/executor/Cargo.toml b/protocol-units/execution/suzuka/executor/Cargo.toml index 91391697d..901c66c54 100644 --- a/protocol-units/execution/suzuka/executor/Cargo.toml +++ b/protocol-units/execution/suzuka/executor/Cargo.toml @@ -14,7 +14,6 @@ path = "src/lib.rs" [dependencies] anyhow = { workspace = true } -chrono = { workspace = true } fail = { workspace = true } log = { workspace = true } thiserror = { workspace = true } @@ -62,7 +61,11 @@ aptos-temppath = { workspace = true } maptos-opt-executor = { workspace = true } maptos-execution-util = { workspace = true } +movement-types = { workspace = true } dirs = "5.0.1" tempfile = "3.10.1" async-trait = "0.1.80" + +[dev-dependencies] +chrono = { workspace = true } diff --git a/protocol-units/execution/suzuka/executor/src/lib.rs b/protocol-units/execution/suzuka/executor/src/lib.rs index bee4a7253..f747f637c 100644 --- a/protocol-units/execution/suzuka/executor/src/lib.rs +++ b/protocol-units/execution/suzuka/executor/src/lib.rs @@ -4,13 +4,16 @@ pub use aptos_types::{ transaction::signature_verified_transaction::SignatureVerifiedTransaction, block_executor::partitioner::ExecutableBlock, block_executor::partitioner::ExecutableTransactions, - transaction::{SignedTransaction, Transaction} + transaction::{SignedTransaction, Transaction}, + block_metadata::BlockMetadata, }; pub use aptos_crypto::hash::HashValue; -use async_channel::Sender; use aptos_api::runtime::Apis; + pub use maptos_execution_util::FinalityMode; +use movement_types::BlockCommitment; +use async_channel::Sender; #[tonic::async_trait] pub trait SuzukaExecutor { @@ -26,7 +29,7 @@ pub trait SuzukaExecutor { &self, mode: FinalityMode, block: ExecutableBlock, - ) -> Result<(), anyhow::Error>; + ) -> Result; /// Sets the transaction channel. fn set_tx_channel( @@ -39,5 +42,8 @@ pub trait SuzukaExecutor { /// Get block head height. async fn get_block_head_height(&self) -> Result; + + /// Build block metadata for a timestamp + async fn build_block_metadata(&self, block_id : HashValue, timestamp: u64) -> Result; } diff --git a/protocol-units/execution/suzuka/executor/src/v1.rs b/protocol-units/execution/suzuka/executor/src/v1.rs index a1c85b964..aac999891 100644 --- a/protocol-units/execution/suzuka/executor/src/v1.rs +++ b/protocol-units/execution/suzuka/executor/src/v1.rs @@ -1,7 +1,11 @@ +// FIXME: glob imports are bad style use crate::*; use maptos_opt_executor::Executor; -use async_channel::Sender; use aptos_types::transaction::SignedTransaction; +use movement_types::BlockCommitment; + +use async_channel::Sender; +use tracing::debug; #[derive(Clone)] pub struct SuzukaExecutorV1 { @@ -50,12 +54,12 @@ impl SuzukaExecutor for SuzukaExecutorV1 { &self, mode: FinalityMode, block: ExecutableBlock, - ) -> Result<(), anyhow::Error> { + ) -> Result { match mode { FinalityMode::Dyn => unimplemented!(), FinalityMode::Opt => { - println!("Executing opt block: {:?}", block.block_id); + debug!("Executing block: {:?}", block.block_id); self.executor.execute_block(block).await }, FinalityMode::Fin => unimplemented!(), @@ -82,10 +86,29 @@ impl SuzukaExecutor for SuzukaExecutorV1 { /// Get block head height. async fn get_block_head_height(&self) -> Result { - // ideally, this should read from the ledger - Ok(1) + self.executor.get_block_head_height() } + /// Build block metadata for a timestamp + async fn build_block_metadata(&self, block_id : HashValue, timestamp: u64) -> Result { + + let (epoch, round) = self.executor.get_next_epoch_and_round().await?; + // Clone the signer from the executor for signing the metadata. + let signer = self.executor.signer.clone(); + + // Create a block metadata transaction. + Ok(BlockMetadata::new( + block_id, + epoch, + round, + signer.author(), + vec![], + vec![], + timestamp, + )) + + } + } #[cfg(test)] @@ -109,11 +132,6 @@ mod opt_tests { accept_type::AcceptType, transactions::SubmitTransactionPost }; - use futures::SinkExt; - use aptos_mempool::{ - MempoolClientRequest, MempoolClientSender, - }; - use futures::channel::oneshot; fn create_signed_transaction(gas_unit_price: u64) -> SignedTransaction { let private_key = Ed25519PrivateKey::generate_for_testing(); @@ -220,12 +238,19 @@ mod opt_tests { // Now execute the block let block_id = HashValue::random(); - let tx = SignatureVerifiedTransaction::Valid(Transaction::UserTransaction( - received_transaction - )); - let txs = ExecutableTransactions::Unsharded(vec![tx]); + let block_metadata = executor.build_block_metadata( + block_id.clone(), + chrono::Utc::now().timestamp_micros() as u64, + ).await.unwrap(); + let txs = ExecutableTransactions::Unsharded([ + Transaction::BlockMetadata(block_metadata), + Transaction::UserTransaction(received_transaction), + ].into_iter().map(SignatureVerifiedTransaction::Valid).collect()); let block = ExecutableBlock::new(block_id.clone(), txs); - executor.execute_block(FinalityMode::Opt, block).await?; + let commitment = executor.execute_block(FinalityMode::Opt, block).await?; + + assert_eq!(commitment.block_id.to_vec(), block_id.to_vec()); + assert_eq!(commitment.height, 1); services_handle.abort(); background_handle.abort(); diff --git a/protocol-units/settlement/mcr/client/Cargo.toml b/protocol-units/settlement/mcr/client/Cargo.toml new file mode 100644 index 000000000..197884a59 --- /dev/null +++ b/protocol-units/settlement/mcr/client/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "mcr-settlement-client" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +publish = { workspace = true } +rust-version = { workspace = true } + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +async-trait = { workspace = true } +tokio = { workspace = true } +anyhow = { workspace = true } +tokio-stream = { workspace = true } +movement-types = { workspace = true } +serde_json = { workspace = true } +async-stream = { workspace = true } + +[dev-dependencies] +futures = { workspace = true } + +[features] +mock = [] + +[lints] +workspace = true diff --git a/protocol-units/settlement/mcr/client/src/lib.rs b/protocol-units/settlement/mcr/client/src/lib.rs new file mode 100644 index 000000000..4c5f7c27d --- /dev/null +++ b/protocol-units/settlement/mcr/client/src/lib.rs @@ -0,0 +1,26 @@ +use movement_types::BlockCommitment; +use tokio_stream::Stream; + +#[cfg(feature = "mock")] +pub mod mock; + +type CommitmentStream = + std::pin::Pin> + Send>>; + +#[async_trait::async_trait] +pub trait McrSettlementClientOperations { + + async fn post_block_commitment( + &self, + block_commitment: BlockCommitment, + ) -> Result<(), anyhow::Error>; + + async fn post_block_commitment_batch(&self, block_commitment: Vec) -> Result<(), anyhow::Error>; + + async fn stream_block_commitments(&self) -> Result; + + async fn get_commitment_at_height(&self, height : u64) -> Result, anyhow::Error>; + + async fn get_max_tolerable_block_height(&self) -> Result; + +} diff --git a/protocol-units/settlement/mcr/client/src/mock.rs b/protocol-units/settlement/mcr/client/src/mock.rs new file mode 100644 index 000000000..8942de4bd --- /dev/null +++ b/protocol-units/settlement/mcr/client/src/mock.rs @@ -0,0 +1,262 @@ +use crate::{CommitmentStream, McrSettlementClientOperations}; +use movement_types::BlockCommitment; +use std::collections::BTreeMap; +use std::sync::{Arc, Mutex}; +use tokio::sync::{mpsc, RwLock}; +use tokio_stream::wrappers::ReceiverStream; + +#[derive(Clone)] +pub struct MockMcrSettlementClient { + commitments: Arc>>, + stream_sender: mpsc::Sender>, + stream_receiver: Arc>>>>, + pub current_height: Arc>, + pub block_lead_tolerance: u64, + paused_at_height: Arc>>, +} + +impl MockMcrSettlementClient { + pub fn new() -> Self { + let (stream_sender, receiver) = mpsc::channel(10); + MockMcrSettlementClient { + commitments: Arc::new(RwLock::new(BTreeMap::new())), + stream_sender, + stream_receiver: Arc::new(Mutex::new(Some(receiver))), + current_height: Arc::new(RwLock::new(0)), + block_lead_tolerance: 16, + paused_at_height: Arc::new(RwLock::new(None)), + } + } + + /// Overrides the commitment to settle on at given height. + /// + /// To have effect, this method needs to be called before a commitment is + /// posted for this height with the `McrSettlementClientOperations` API. + pub async fn override_block_commitment(&self, commitment: BlockCommitment) { + let mut commitments = self.commitments.write().await; + commitments.insert(commitment.height, commitment); + } + + /// Stop streaming commitments after the given height. + /// + /// Any posted commitments will be accumulated. + pub async fn pause_after(&self, height: u64) { + let mut paused_at_height = self.paused_at_height.write().await; + *paused_at_height = Some(height); + } + + /// Stream any commitments that have been posted following the height + /// at which `pause` was called, and resume streaming any newly posted + /// commitments + pub async fn resume(&self) { + let resume_height = { + let mut paused_at_height = self.paused_at_height.write().await; + paused_at_height.take().expect("not paused") + }; + { + let commitments = self.commitments.read().await; + for (_, commitment) in commitments.range(resume_height + 1..) { + println!("resume sends commitment for height {}", commitment.height); + self.stream_sender.send(Ok(commitment.clone())).await.unwrap(); + } + } + } +} + +#[async_trait::async_trait] +impl McrSettlementClientOperations for MockMcrSettlementClient { + async fn post_block_commitment( + &self, + block_commitment: BlockCommitment, + ) -> Result<(), anyhow::Error> { + + let height = block_commitment.height; + + let settled = { + let mut commitments = self.commitments.write().await; + commitments.entry(block_commitment.height).or_insert(block_commitment).clone() + }; + { + let paused_at_height = self.paused_at_height.read().await; + match *paused_at_height { + Some(ph) if ph < height => {} + _ => { + self.stream_sender.send(Ok(settled)).await?; + } + } + } + + { + let mut current_height = self.current_height.write().await; + if height > *current_height { + *current_height = height; + } + } + + Ok(()) + } + + async fn post_block_commitment_batch(&self, block_commitment: Vec) -> Result<(), anyhow::Error> { + for commitment in block_commitment { + self.post_block_commitment(commitment).await?; + } + Ok(()) + } + + async fn stream_block_commitments(&self) -> Result { + let receiver = self.stream_receiver + .lock() + .unwrap() + .take() + .expect("stream_block_commitments already called"); + Ok(Box::pin(ReceiverStream::new(receiver))) + } + + async fn get_commitment_at_height( + &self, + height: u64, + ) -> Result, anyhow::Error> { + let guard = self.commitments.read().await; + Ok(guard.get(&height).cloned()) + } + + async fn get_max_tolerable_block_height(&self) -> Result { + Ok(*self.current_height.read().await + self.block_lead_tolerance) + } + +} + +#[cfg(test)] +pub mod test { + + use super::*; + use movement_types::Commitment; + + use futures::future; + use tokio_stream::StreamExt; + use tokio::select; + + #[tokio::test] + async fn test_post_block_commitment() -> Result<(), anyhow::Error> { + + let client = MockMcrSettlementClient::new(); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment::test(), + }; + client.post_block_commitment(commitment.clone()).await.unwrap(); + let guard = client.commitments.write().await; + assert_eq!(guard.get(&1), Some(&commitment)); + + assert_eq!(*client.current_height.read().await, 1); + assert_eq!(client.get_max_tolerable_block_height().await?, 17); + + Ok(()) + } + + #[tokio::test] + async fn test_post_block_commitment_batch() -> Result<(), anyhow::Error> { + let client = MockMcrSettlementClient::new(); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment::test(), + }; + let commitment2 = BlockCommitment { + height: 2, + block_id: Default::default(), + commitment: Commitment::test(), + }; + client.post_block_commitment_batch(vec![ + commitment.clone(), + commitment2.clone(), + ]).await.unwrap(); + let guard = client.commitments.write().await; + assert_eq!(guard.get(&1), Some(&commitment)); + assert_eq!(guard.get(&2), Some(&commitment2)); + Ok(()) + } + + #[tokio::test] + async fn test_stream_block_commitments() -> Result<(), anyhow::Error> { + let client = MockMcrSettlementClient::new(); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment::test(), + }; + client.post_block_commitment(commitment.clone()).await.unwrap(); + let mut stream = client.stream_block_commitments().await?; + assert_eq!(stream.next().await.unwrap().unwrap(), commitment); + Ok(()) + } + + #[tokio::test] + async fn test_override_block_commitments() -> Result<(), anyhow::Error> { + let client = MockMcrSettlementClient::new(); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment::test(), + }; + client.override_block_commitment(commitment.clone()).await; + client.post_block_commitment(BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }).await.unwrap(); + let mut stream = client.stream_block_commitments().await?; + assert_eq!(stream.next().await.expect("stream has ended")?, commitment); + Ok(()) + } + + #[tokio::test] + async fn test_pause() -> Result<(), anyhow::Error> { + let client = MockMcrSettlementClient::new(); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }; + client.pause_after(1).await; + client.post_block_commitment(commitment.clone()).await?; + let commitment2 = BlockCommitment { + height: 2, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }; + client.post_block_commitment(commitment2).await?; + let mut stream = client.stream_block_commitments().await?; + assert_eq!(stream.next().await.expect("stream has ended")?, commitment); + select! { + biased; + _ = stream.next() => panic!("stream should be paused"), + _ = future::ready(()) => {} + } + Ok(()) + } + + #[tokio::test] + async fn test_resume() -> Result<(), anyhow::Error> { + let client = MockMcrSettlementClient::new(); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }; + client.pause_after(1).await; + client.post_block_commitment(commitment.clone()).await?; + let commitment2 = BlockCommitment { + height: 2, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }; + client.post_block_commitment(commitment2.clone()).await?; + let mut stream = client.stream_block_commitments().await?; + assert_eq!(stream.next().await.expect("stream has ended")?, commitment); + client.resume().await; + assert_eq!(stream.next().await.expect("stream has ended")?, commitment2); + Ok(()) + } +} diff --git a/protocol-units/settlement/mcr/contracts/broadcast/.gitignore b/protocol-units/settlement/mcr/contracts/broadcast/.gitignore new file mode 100644 index 000000000..ef17dd661 --- /dev/null +++ b/protocol-units/settlement/mcr/contracts/broadcast/.gitignore @@ -0,0 +1 @@ +*.sol diff --git a/protocol-units/settlement/mcr/manager/Cargo.toml b/protocol-units/settlement/mcr/manager/Cargo.toml new file mode 100644 index 000000000..d6c28baea --- /dev/null +++ b/protocol-units/settlement/mcr/manager/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "mcr-settlement-manager" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +publish = { workspace = true } +rust-version = { workspace = true } + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +async-trait = { workspace = true } +tokio = { workspace = true } +anyhow = { workspace = true } +tokio-stream = { workspace = true } +movement-types = { workspace = true } +serde_json = { workspace = true } +async-stream = { workspace = true } +mcr-settlement-client = { workspace = true } + +[dev-dependencies] +mcr-settlement-client = { workspace = true, features = ["mock"] } + +[features] +default = ["stub"] +stub = [] + +[lints] +workspace = true diff --git a/protocol-units/settlement/mcr/manager/src/lib.rs b/protocol-units/settlement/mcr/manager/src/lib.rs new file mode 100644 index 000000000..287b806b7 --- /dev/null +++ b/protocol-units/settlement/mcr/manager/src/lib.rs @@ -0,0 +1,20 @@ +use movement_types::{BlockCommitment, BlockCommitmentEvent}; +use tokio_stream::Stream; + +mod manager; + +pub use manager::Manager as McrSettlementManager; + +pub type CommitmentEventStream = + std::pin::Pin> + Send>>; + +#[async_trait::async_trait] +pub trait McrSettlementManagerOperations { + + /// Adds a block commitment to the manager queue. + async fn post_block_commitment( + &self, + block_commitment: BlockCommitment, + ) -> Result<(), anyhow::Error>; + +} diff --git a/protocol-units/settlement/mcr/manager/src/manager.rs b/protocol-units/settlement/mcr/manager/src/manager.rs new file mode 100644 index 000000000..72a8e14aa --- /dev/null +++ b/protocol-units/settlement/mcr/manager/src/manager.rs @@ -0,0 +1,241 @@ +use crate::{BlockCommitmentEvent, CommitmentEventStream, McrSettlementManagerOperations}; + +use mcr_settlement_client::McrSettlementClientOperations; +use movement_types::{BlockCommitment, BlockCommitmentRejectionReason}; + +use async_stream::stream; +use async_trait::async_trait; +use tokio::sync::mpsc; +use tokio_stream::StreamExt; + +use std::collections::BTreeMap; +use std::mem; + +/// Public handle for the MCR settlement manager. +pub struct Manager { + sender: mpsc::Sender, +} + +impl Manager { + /// Creates a new MCR settlement manager. + /// + /// Returns the handle with the public API and the stream to receive commitment events. + /// The stream needs to be polled to drive the MCR settlement client and + /// process the commitments. + pub fn new( + client: C, + ) -> (Self, CommitmentEventStream) { + let (sender, receiver) = mpsc::channel(16); + let event_stream = process_commitments(receiver, client); + (Self { sender }, event_stream) + } +} + +#[async_trait] +impl McrSettlementManagerOperations for Manager { + async fn post_block_commitment( + &self, + block_commitment: BlockCommitment, + ) -> Result<(), anyhow::Error> { + self.sender.send(block_commitment).await?; + Ok(()) + } +} + +fn process_commitments( + mut receiver: mpsc::Receiver, + client: C, +) -> CommitmentEventStream { + // Can't mix try_stream! and select!, see https://github.com/tokio-rs/async-stream/issues/63 + Box::pin(stream! { + let mut settlement_stream = client.stream_block_commitments().await?; + let mut max_height = client.get_max_tolerable_block_height().await?; + let mut ahead_of_settlement = false; + let mut commitments_to_settle = BTreeMap::new(); + let mut batch_acc = Vec::new(); + loop { + tokio::select! { + Some(block_commitment) = receiver.recv(), if !ahead_of_settlement => { + commitments_to_settle.insert( + block_commitment.height, + block_commitment.commitment.clone(), + ); + if block_commitment.height > max_height { + ahead_of_settlement = true; + let batch = mem::replace(&mut batch_acc, Vec::new()); + if let Err(e) = client.post_block_commitment_batch(batch).await { + yield Err(e); + break; + } + } + batch_acc.push(block_commitment); + } + Some(res) = settlement_stream.next() => { + let settled_commitment = match res { + Ok(commitment) => commitment, + Err(e) => { + yield Err(e); + break; + } + }; + + let height = settled_commitment.height; + if let Some(commitment) = commitments_to_settle.remove(&height) { + let event = if commitment == settled_commitment.commitment { + BlockCommitmentEvent::Accepted(settled_commitment) + } else { + BlockCommitmentEvent::Rejected { + height, + reason: BlockCommitmentRejectionReason::InvalidCommitment, + } + }; + yield Ok(event); + } else if let Some((&lh, _)) = commitments_to_settle.last_key_value() { + if lh < height { + // Settlement has left some commitments behind, but the client could + // deliver them of order? + todo!("Handle falling behind on settlement") + } + } + // Remove back-pressure if we can proceed settling new blocks. + if ahead_of_settlement { + let new_max_height = match client.get_max_tolerable_block_height().await { + Ok(h) => h, + Err(e) => { + yield Err(e); + break; + } + }; + if new_max_height > max_height { + max_height = new_max_height; + ahead_of_settlement = false; + } + } + } + else => break + } + } + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use mcr_settlement_client::mock::MockMcrSettlementClient; + use movement_types::{BlockCommitment, Commitment}; + + #[tokio::test] + async fn test_block_commitment_accepted() -> Result<(), anyhow::Error> { + let mut client = MockMcrSettlementClient::new(); + client.block_lead_tolerance = 1; + let (manager, mut event_stream) = Manager::new(client.clone()); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }; + manager.post_block_commitment(commitment.clone()).await?; + let commitment2 = BlockCommitment { + height: 2, + block_id: Default::default(), + commitment: Commitment([2; 32]), + }; + manager.post_block_commitment(commitment2).await?; + let item = event_stream.next().await; + let res = item.unwrap(); + let event = res.unwrap(); + assert_eq!(event, BlockCommitmentEvent::Accepted(commitment)); + Ok(()) + } + + #[tokio::test] + async fn test_block_commitment_rejected() -> Result<(), anyhow::Error> { + let mut client = MockMcrSettlementClient::new(); + client.block_lead_tolerance = 1; + let (manager, mut event_stream) = Manager::new(client.clone()); + let commitment = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }; + client.override_block_commitment(BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment([3; 32]), + }).await; + manager.post_block_commitment(commitment.clone()).await?; + let commitment2 = BlockCommitment { + height: 2, + block_id: Default::default(), + commitment: Commitment([2; 32]), + }; + manager.post_block_commitment(commitment2).await?; + let item = event_stream.next().await; + let res = item.unwrap(); + let event = res.unwrap(); + assert_eq!(event, BlockCommitmentEvent::Rejected { + height: 1, + reason: BlockCommitmentRejectionReason::InvalidCommitment, + }); + Ok(()) + } + + #[tokio::test] + async fn test_back_pressure() -> Result<(), anyhow::Error> { + let mut client = MockMcrSettlementClient::new(); + client.block_lead_tolerance = 2; + client.pause_after(2).await; + let (manager, mut event_stream) = Manager::new(client.clone()); + + let commitment1 = BlockCommitment { + height: 1, + block_id: Default::default(), + commitment: Commitment([1; 32]), + }; + manager.post_block_commitment(commitment1.clone()).await?; + let commitment2 = BlockCommitment { + height: 2, + block_id: Default::default(), + commitment: Commitment([2; 32]), + }; + manager.post_block_commitment(commitment2.clone()).await?; + let commitment3 = BlockCommitment { + height: 3, + block_id: Default::default(), + commitment: Commitment([3; 32]), + }; + manager.post_block_commitment(commitment3.clone()).await?; + + let event = event_stream.next().await.expect("stream has ended")?; + assert_eq!(event, BlockCommitmentEvent::Accepted(commitment1.clone())); + let event = event_stream.next().await.expect("stream has ended")?; + assert_eq!(event, BlockCommitmentEvent::Accepted(commitment2.clone())); + + // The batch of first two should have been posted, + // the third commitment is batched in the manager. + assert_eq!(client.get_commitment_at_height(1).await?, Some(commitment1.clone())); + assert_eq!(client.get_commitment_at_height(2).await?, Some(commitment2.clone())); + assert_eq!(client.get_commitment_at_height(3).await?, None); + + // Unblock the client, allowing processing of commitments to resume. + client.resume().await; + + let commitment4 = BlockCommitment { + height: 4, + block_id: Default::default(), + commitment: Commitment([4; 32]), + }; + manager.post_block_commitment(commitment4).await?; + let commitment5 = BlockCommitment { + height: 5, + block_id: Default::default(), + commitment: Commitment([5; 32]), + }; + manager.post_block_commitment(commitment5).await?; + + let event = event_stream.next().await.expect("stream has ended")?; + assert_eq!(event, BlockCommitmentEvent::Accepted(commitment3.clone())); + + Ok(()) + } +} diff --git a/scripts/build/prebuild b/scripts/build/prebuild new file mode 100755 index 000000000..617f2adf8 --- /dev/null +++ b/scripts/build/prebuild @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +MOVEMENT_BASE_STORAGE_PATH=./.movement +cargo build --release + +# Build aptos components +temp_dir=$MOVEMENT_BASE_STORAGE_PATH/monza-aptos +cp -R "$MONZA_APTOS_PATH" "$temp_dir" +WORKING_DIR=$(pwd) +temp_dir=$MOVEMENT_BASE_STORAGE_PATH/monza-aptos +cp -R "$MONZA_APTOS_PATH" "$temp_dir" +chmod -R 755 $temp_dir +cd $MOVEMENT_BASE_STORAGE_PATH/monza-aptos +echo "Building aptos-faucet-service..." +cargo build $CARGO_PROFILE_FLAGS -p aptos-faucet-service +echo "Built aptos-faucet-service!" +cd $WORKING_DIR \ No newline at end of file diff --git a/scripts/celestia/celestia-env b/scripts/celestia/celestia-env index fdfed4d72..7702541a0 100755 --- a/scripts/celestia/celestia-env +++ b/scripts/celestia/celestia-env @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash +set -e export DA_BLOCK_HEIGHT=0 export CELESTIA_NODE_AUTH_TOKEN= export CELESTIA_ADDRESS= @@ -7,6 +8,9 @@ export CELESTIA_CHAIN_ID="$(openssl rand -hex 10)" export APP_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/.celestia-app" export NODE_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/bridge" +: ${CELESTIA_LOG_LEVEL:="INFO"} +export CELESTIA_LOG_LEVEL + contains() { local value="$1" shift # Shift the arguments to leave the rest of the array diff --git a/scripts/celestia/celestia-local-appd b/scripts/celestia/celestia-local-appd index fb17a124f..acf22b98c 100755 --- a/scripts/celestia/celestia-local-appd +++ b/scripts/celestia/celestia-local-appd @@ -1,4 +1,6 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e +LOG_LEVEL=$(echo "$CELESTIA_LOG_LEVEL" | awk '{print tolower($0)}') APP_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/.celestia-app" NODE_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/bridge" -celestia-appd start --grpc.enable --home $APP_PATH \ No newline at end of file +celestia-appd start --grpc.enable --home $APP_PATH --log_level $LOG_LEVEL \ No newline at end of file diff --git a/scripts/celestia/celestia-local-bridge b/scripts/celestia/celestia-local-bridge index ff8ea5613..f3cde5be9 100755 --- a/scripts/celestia/celestia-local-bridge +++ b/scripts/celestia/celestia-local-bridge @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e APP_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/.celestia-app" NODE_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/bridge" @@ -29,7 +30,8 @@ echo "$CELESTIA_CUSTOM" celestia bridge init --node.store $NODE_PATH celestia bridge start \ --node.store $NODE_PATH --gateway \ - --core.ip 127.0.0.1 \ + --core.ip 0.0.0.0 \ --keyring.accname validator \ --gateway.addr 0.0.0.0 \ - --rpc.addr 0.0.0.0 \ \ No newline at end of file + --rpc.addr 0.0.0.0 \ + --log.level $CELESTIA_LOG_LEVEL \ No newline at end of file diff --git a/scripts/celestia/celestia-local-init b/scripts/celestia/celestia-local-init index d9054310a..5ec915b02 100755 --- a/scripts/celestia/celestia-local-init +++ b/scripts/celestia/celestia-local-init @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e APP_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/.celestia-app" NODE_PATH="$MOVEMENT_BASE_STORAGE_PATH/celestia/${CELESTIA_CHAIN_ID}/bridge" diff --git a/scripts/celestia/create-and-fund-account b/scripts/celestia/create-and-fund-account index 775cf2510..35ade5ba6 100755 --- a/scripts/celestia/create-and-fund-account +++ b/scripts/celestia/create-and-fund-account @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash +set -e # Maximum number of retries max_retries=10 # Delay in seconds between retries diff --git a/scripts/celestia/get-arabica-11-address b/scripts/celestia/get-arabica-11-address index 7083f7046..d93b39d58 100755 --- a/scripts/celestia/get-arabica-11-address +++ b/scripts/celestia/get-arabica-11-address @@ -1,3 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e cd ~/.celestia-light-arabica-11 cel-key list --node.type light --keyring-backend test --p2p.network arabica --output json | sed '1d' | jq -r '.[0].address' \ No newline at end of file diff --git a/scripts/celestia/get-local-address b/scripts/celestia/get-local-address index 2b0e54ff6..cdcad2776 100755 --- a/scripts/celestia/get-local-address +++ b/scripts/celestia/get-local-address @@ -1,2 +1,3 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e cel-key list --node.type light --keyring-backend test --home $APP_PATH --keyring-dir $APP_PATH --output json | sed '1d' | jq -r '.[0].address' \ No newline at end of file diff --git a/scripts/docker/build-push-image b/scripts/docker/build-push-image new file mode 100755 index 000000000..1d5ae7bf5 --- /dev/null +++ b/scripts/docker/build-push-image @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if the correct number of arguments are passed +if [ "$#" -ne 3 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Get the current commit hash +COMMIT_HASH=$(git rev-parse HEAD) + +# Get the current branch name and replace any '/' with '.' +BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) +SANITIZED_BRANCH_NAME=${BRANCH_NAME//\//.} + +# Tag and build the Docker image +echo "Building docker image with tags $2/$3:$COMMIT_HASH and $2/$3:$SANITIZED_BRANCH_NAME" +docker build -f $1 -t $2/$3:$COMMIT_HASH -t $2/$3:$SANITIZED_BRANCH_NAME . + +# Push the Docker images +docker push $2/$3:$COMMIT_HASH +docker push $2/$3:$SANITIZED_BRANCH_NAME \ No newline at end of file diff --git a/scripts/monza/faucet b/scripts/monza/faucet index 65b28bc9c..9a2af1b8e 100755 --- a/scripts/monza/faucet +++ b/scripts/monza/faucet @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e # Copy the directory from the Nix store to a temporary location temp_dir=$MOVEMENT_BASE_STORAGE_PATH/monza-aptos @@ -20,7 +21,7 @@ echo " - Faucet URL: $MONZA_APTOS_FAUCET_LISTEN_ADDR" # Run the faucet service using cargo echo "Starting faucet service..." -./target/debug/aptos-faucet-service run-simple --key "$MONZA_APTOS_PRIVATE_KEY" \ +./target/$CARGO_PROFILE/aptos-faucet-service run-simple --key "$MONZA_APTOS_PRIVATE_KEY" \ --node-url "http://$MONZA_APTOS_REST_LISTEN_ADDR" --chain-id "$MONZA_CHAIN_ID" \ --listen-address "$LISTEN_ADDR" --listen-port "$LISTEN_PORT" diff --git a/scripts/movement/build-push-image b/scripts/movement/build-push-image new file mode 100755 index 000000000..e3afa3441 --- /dev/null +++ b/scripts/movement/build-push-image @@ -0,0 +1,3 @@ +#!/bin/bash +FILE_PATH=./docker/build/$1/Dockerfile +./scripts/docker/build-push-image $FILE_PATH mvlbs $1 \ No newline at end of file diff --git a/scripts/movement/run b/scripts/movement/run index 4fafed2ac..78967c21b 100755 --- a/scripts/movement/run +++ b/scripts/movement/run @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e set -euo pipefail export PATH=$PATH:./target/release diff --git a/scripts/preludes/m1-da-light-node/prelude b/scripts/preludes/m1-da-light-node/prelude index 0a18f3cf4..12ce5473a 100755 --- a/scripts/preludes/m1-da-light-node/prelude +++ b/scripts/preludes/m1-da-light-node/prelude @@ -1,8 +1,21 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e export MOVE_ROCKS_CHAIN_ID="$(openssl rand -hex 10)" export MOVE_ROCKS_PATH="$MOVEMENT_BASE_STORAGE_PATH/move-rocks/${MOVE_ROCKS_CHAIN_ID}/.move-rocks" + . ./scripts/celestia/celestia-env +: ${MOVEMENT_PREBUILT:=false} +export MOVEMENT_PREBUILT +: ${CARGO_PROFILE:=debug} +export CARGO_PROFILE + +if [ "$CARGO_PROFILE" = "release" ]; then + CARGO_PROFILE_FLAGS="--release" +else + CARGO_PROFILE_FLAGS="" +fi + echo "Building m1-da-light-node..." -cargo build -p m1-da-light-node -echo "Built m1-da-light-node!" \ No newline at end of file +cargo build $CARGO_PROFILE_FLAGS -p m1-da-light-node +echo "Built m1-da-light-node!" diff --git a/scripts/preludes/monza-full-node/prelude b/scripts/preludes/monza-full-node/prelude index 11cd19db6..97aeb9ca1 100755 --- a/scripts/preludes/monza-full-node/prelude +++ b/scripts/preludes/monza-full-node/prelude @@ -1,30 +1,48 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e export MOVE_ROCKS_CHAIN_ID="$(openssl rand -hex 10)" export MOVE_ROCKS_PATH="$MOVEMENT_BASE_STORAGE_PATH/move-rocks/${MOVE_ROCKS_CHAIN_ID}/.move-rocks" . ./scripts/celestia/celestia-env -# build monza -echo "Building monza-config..." -cargo build --bin monza-config -echo "Built monza-config!" - -echo "Building m1-da-light-node..." -cargo build -p m1-da-light-node --features "sequencer" -echo "Built m1-da-light-node!" - -echo "Building monza-full-node..." -cargo build -p monza-full-node -echo "Built monza-full-node!" - -# build aptos -WORKING_DIR=$(pwd) -temp_dir=$MOVEMENT_BASE_STORAGE_PATH/monza-aptos -cp -R "$MONZA_APTOS_PATH" "$temp_dir" -chmod -R 755 $temp_dir -cd $MOVEMENT_BASE_STORAGE_PATH/monza-aptos -echo "Building aptos-faucet-service..." -cargo build -p aptos-faucet-service -echo "Built aptos-faucet-service!" -cd $WORKING_DIR - -eval $(./target/debug/monza-config) \ No newline at end of file +: ${MOVEMENT_PREBUILT:=false} +export MOVEMENT_PREBUILT +: ${CARGO_PROFILE:=debug} +export CARGO_PROFILE + +if [ "$CARGO_PROFILE" = "release" ]; then + CARGO_PROFILE_FLAGS="--release" +else + CARGO_PROFILE_FLAGS="" +fi + +if [ "$MOVEMENT_PREBUILT" != "true" ]; then + + # Build movement components + echo "Building monza-config..." + cargo build $CARGO_PROFILE_FLAGS --bin monza-config + echo "Built monza-config!" + + echo "Building m1-da-light-node..." + cargo build $CARGO_PROFILE_FLAGS -p m1-da-light-node --features "sequencer" + echo "Built m1-da-light-node!" + + echo "Building monza-full-node..." + cargo build $CARGO_PROFILE_FLAGS -p monza-full-node + echo "Built monza-full-node!" + + # Build aptos components + WORKING_DIR=$(pwd) + temp_dir=$MOVEMENT_BASE_STORAGE_PATH/monza-aptos + cp -R "$MONZA_APTOS_PATH" "$temp_dir" + chmod -R 755 $temp_dir + cd $MOVEMENT_BASE_STORAGE_PATH/monza-aptos + echo "Building aptos-faucet-service..." + cargo build $CARGO_PROFILE_FLAGS -p aptos-faucet-service + echo "Built aptos-faucet-service!" + cd $WORKING_DIR + +else + echo "MOVEMENT_PREBUILT is set, skipping build." +fi + +eval $(./target/$CARGO_PROFILE/monza-config) diff --git a/scripts/preludes/suzuka-full-node/prelude b/scripts/preludes/suzuka-full-node/prelude new file mode 100755 index 000000000..efa3f26d3 --- /dev/null +++ b/scripts/preludes/suzuka-full-node/prelude @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -e + +# export CELESTIA_LOG_LEVEL=debug + +export MOVE_ROCKS_CHAIN_ID="$(openssl rand -hex 10)" +export MOVE_ROCKS_PATH="$MOVEMENT_BASE_STORAGE_PATH/move-rocks/${MOVE_ROCKS_CHAIN_ID}/.move-rocks" +. ./scripts/celestia/celestia-env + +: ${MOVEMENT_PREBUILT:=false} +export MOVEMENT_PREBUILT +: ${CARGO_PROFILE:=debug} +export CARGO_PROFILE + +if [ "$CARGO_PROFILE" = "release" ]; then + CARGO_PROFILE_FLAGS="--release" +else + CARGO_PROFILE_FLAGS="" +fi + +if [ "$MOVEMENT_PREBUILT" != "true" ]; then + + # Build movement components + echo "Building suzuka-config..." + cargo build $CARGO_PROFILE_FLAGS --bin suzuka-config + echo "Built suzuka-config!" + + echo "Building m1-da-light-node..." + cargo build $CARGO_PROFILE_FLAGS -p m1-da-light-node --features "sequencer" + echo "Built m1-da-light-node!" + + echo "Building suzuka-full-node..." + cargo build $CARGO_PROFILE_FLAGS -p suzuka-full-node + echo "Built suzuka-full-node!" + + # Build aptos components + WORKING_DIR=$(pwd) + temp_dir=$MOVEMENT_BASE_STORAGE_PATH/monza-aptos + cp -R "$MONZA_APTOS_PATH" "$temp_dir" + chmod -R 755 $temp_dir + cd $MOVEMENT_BASE_STORAGE_PATH/monza-aptos + echo "Building aptos-faucet-service..." + cargo build $CARGO_PROFILE_FLAGS -p aptos-faucet-service + echo "Built aptos-faucet-service!" + cd $WORKING_DIR + +else + echo "MOVEMENT_PREBUILT is set, skipping build." +fi + +eval $(./target/$CARGO_PROFILE/suzuka-config) diff --git a/scripts/suzuka/faucet b/scripts/suzuka/faucet new file mode 100755 index 000000000..9a2af1b8e --- /dev/null +++ b/scripts/suzuka/faucet @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -e + +# Copy the directory from the Nix store to a temporary location +temp_dir=$MOVEMENT_BASE_STORAGE_PATH/monza-aptos + +# Change to the temporary directory +cd "$temp_dir" + +# Split the listen addresses into an array +IFS=':' read -r -a listener_array <<< "$MONZA_APTOS_FAUCET_LISTEN_ADDR" + +# Extract the listen address and port +LISTEN_ADDR="${listener_array[0]}" +LISTEN_PORT="${listener_array[1]}" + +echo "Starting faucet service with the following configuration:" +echo " - Chain ID: $MONZA_CHAIN_ID" +echo " - Node URL: $MONZA_APTOS_REST_LISTEN_ADDR" +echo " - Faucet URL: $MONZA_APTOS_FAUCET_LISTEN_ADDR" + +# Run the faucet service using cargo +echo "Starting faucet service..." +./target/$CARGO_PROFILE/aptos-faucet-service run-simple --key "$MONZA_APTOS_PRIVATE_KEY" \ + --node-url "http://$MONZA_APTOS_REST_LISTEN_ADDR" --chain-id "$MONZA_CHAIN_ID" \ + --listen-address "$LISTEN_ADDR" --listen-port "$LISTEN_PORT" + +# The script automatically calls cleanup when it exits due to the trap diff --git a/util/buildtime/buildtime-helpers/src/cargo.rs b/util/buildtime/buildtime-helpers/src/cargo.rs index e8649cc3b..899776ecf 100644 --- a/util/buildtime/buildtime-helpers/src/cargo.rs +++ b/util/buildtime/buildtime-helpers/src/cargo.rs @@ -29,7 +29,6 @@ pub mod test { // Get the cargo workspace let workspace = cargo_workspace()?; - println!("cargo_workspace: {:?}", workspace); // Check that a Cargo.toml file exists in the workspace assert_eq!(workspace.join("Cargo.toml").exists(), true); diff --git a/util/buildtime/buildtime-helpers/src/proto.rs b/util/buildtime/buildtime-helpers/src/proto.rs index 1f72c1265..090abc145 100644 --- a/util/buildtime/buildtime-helpers/src/proto.rs +++ b/util/buildtime/buildtime-helpers/src/proto.rs @@ -17,7 +17,6 @@ pub mod test { // Get the proto directory let proto = proto()?; - println!("proto: {:?}", proto); // check that it exists assert_eq!(proto.exists(), true); diff --git a/util/movement-types/Cargo.toml b/util/movement-types/Cargo.toml index 69ddb6ddf..76a9deb7a 100644 --- a/util/movement-types/Cargo.toml +++ b/util/movement-types/Cargo.toml @@ -12,6 +12,8 @@ rust-version = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +aptos-types = { workspace = true } +bcs = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_with = { workspace = true } # derivative = { workspace = true } diff --git a/util/movement-types/src/lib.rs b/util/movement-types/src/lib.rs index 2d28a6619..4587a0ebf 100644 --- a/util/movement-types/src/lib.rs +++ b/util/movement-types/src/lib.rs @@ -1,7 +1,10 @@ -use core::fmt::Display; +use aptos_types::state_proof::StateProof; + use serde::{Deserialize, Serialize}; use sha2::Digest; +use core::fmt; + #[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct Id(pub Vec); @@ -20,8 +23,8 @@ impl Id { } -impl Display for Id { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for Id { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:?}", &self.0) } } @@ -138,4 +141,56 @@ impl Block { self.transactions.push(transaction); } +} + +#[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub struct Commitment(pub [u8; 32]); + +impl Commitment { + pub fn test() -> Self { + Self([0; 32]) + } + + /// Creates a commitment by making a cryptographic digest of the state proof. + pub fn digest_state_proof(state_proof: &StateProof) -> Self { + let mut hasher = sha2::Sha256::new(); + bcs::serialize_into(&mut hasher, &state_proof).expect("unexpected serialization error"); + Self(hasher.finalize().into()) + } +} + +impl From<[u8;32]> for Commitment { + fn from(data : [u8;32]) -> Self { + Self(data) + } +} + +impl From for [u8;32] { + fn from(commitment : Commitment) -> [u8;32] { + commitment.0 + } +} + +#[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub struct BlockCommitment { + pub height : u64, + pub block_id : Id, + pub commitment : Commitment, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum BlockCommitmentRejectionReason { + InvalidBlockId, + InvalidCommitment, + InvalidHeight, + ContractError, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum BlockCommitmentEvent { + Accepted(BlockCommitment), + Rejected { + height: u64, + reason: BlockCommitmentRejectionReason, + }, } \ No newline at end of file