Add Aptos DB fork tool for isolated validator networks - #401
Conversation
|
Mainnet-derived acceptance rerun completed on commit
|
|
Funded test-account re-key support was added in
|
|
Default test-account key and readability refactor acceptance (commit
|
|
Added one-command ephemeral fork lifecycle wrapper in commit Usage: scripts/ephemeral_fork.sh start \
--source-db /data/disposable-checkpoint \
--source-is-disposable \
--fork-tool target/release/aptos-debugger \
--node-binary /path/to/candidate/aptos-node \
--test-account-address 0x1234 \
--work-dir /tmp/contract-forkThe launcher:
Validation: |
|
Added and installed the SHA-based remote ephemeral-mainnet launcher in commit Developer command: scripts/start_remote_ephemeral_mainnet.sh <m1-github-sha>Defaults:
The host has intentional default-deny egress, so the local connector verifies that the SHA is contained in One validator REST API is exposed through an authenticated SSH local forward. Remote validator REST and P2P remain loopback-only; no unauthenticated public REST port is opened. Installed remotely:
Validation:
Documentation: |
|
Public submission API added and verified in commit Endpoint: Implementation:
Real-host acceptance:
The endpoint is unauthenticated and contains only isolated fork state/test funds. Documentation updated in |
bc37a49 to
b9b48ad
Compare
b9b48ad to
07cbe29
Compare
Co-authored-by: Andy <17599867+ganymedio@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
musitdev
left a comment
There was a problem hiding this comment.
I've tested testsuite/forktest/remote/ephemeral_fork.sh. I use an old mainnet db. After some time, it starts correctly. I stop the network but there's no command to restart it. As it takes time to start a network using a prod db, a restart command will be very handy. It avoid starting the node by hand using each generated config.
I didn't find the README that present the command. Some doc that take your PR comment will be helpful to use the tool.
Summary
aptos-debugger aptos-db forkto copy an existing Aptos DB into an isolated forkWhy
Binary and smart-contract testing needs production-shaped state without production consensus or networking impact. Reusing production validator identities risks impersonation and accidental connectivity, while submitting tests to the live validator set affects production state. This tool creates a separate chain from an existing checkpoint with fresh identity and consensus state.
Validation
cargo test -p aptos-db-tool fork::tests -- --nocapturecargo check -p aptos-db-tool --lockedcargo build -p aptos-nodeAPTOS_NODE_BINARY=target/debug/aptos-node cargo test -p aptos-db-tool fork::tests::two_validator_fork_bootstraps_and_commits_blocks -- --ignored --exact --nocapturegit diff --check origin/m1...HEADThe live smoke test starts from a post-genesis DB, replaces the original validator set with two fresh validators, launches two real
aptos-nodeprocesses, observes both nodes commit new ledger versions on chain ID 42, and confirms preserved account state through both REST endpoints.Notes
This validates a local post-genesis source DB. Validation against an actual mainnet-derived checkpoint remains follow-up acceptance work.