aptos-core
aptos-core copied to clipboard
[Bug] mainnet aptos-node can not pass "assert_no_test_natives"
🐛 Bug mainnet aptos-node can not pass "assert_no_test_natives"
To reproduce
When i switch to the mainnet commit and run the aptos-node, it showed :
thread 'main' panicked at 'assertion failed: aptos_natives(NativeGasParameters::zeros(),\n AbstractValueSizeGasParameters::zeros(),\n LATEST_GAS_FEATURE_VERSION).into_iter().all(|(_, module_name,\n func_name, _)|\n module_name.as_str() != \"unit_test\" &&\n func_name.as_str() != \"create_signers_for_testing\")', aptos-move/aptos-vm/src/natives.rs:55:5
And when i print all native move module and function I fould

System information
Please complete the following information:
- branch: mainnet
- commit: 86b29874ff68bece908494a8c54ea35ac2cb0c43
I ran into this as well. Looks like when you run cargo build --release it's build default is to build some test packages (into the "release" bin??) so you have to build the bin explicitly. See:
https://github.com/aptos-labs/aptos-core/issues/5063
If you run cargo build -p aptos-node --release
it will produce the production bin at: target/release/aptos-node
Not sure of the reasoning, but generally the convention most rust software projects follow is just to run cargo build --release and it should produce all the production-ready binaries... If it isn't a huge lift, aptos should consider using this convention for producing the production binaries.
Yea this also happens if you import aptos-sdk into aptos-node and then build it...
same issue here - no chance to get the indexer working with
cargo run --bin aptos-node --features "indexer" -- --config
As a temporary measure you can do git checkout 79009d61de776ac6f096634dd545be5730818c16 and then cargo run --release --bin aptos-node --features "indexer" -- --config meanwhile I will try to figure out what was the cause why testing modules happened to appear in prod release.
Another option is to clean your target folder (rm -rf target) and then manually exclude other packages (works on origin/main): cargo run --release --bin aptos-node -p aptos-node --features "indexer" -- --config ./fullnode.yaml
One thing to note -- I am doing cargo build --release not cargo run --release -- I make my own docker images for deploys (I have a strong preference for RHEL/Fedora) and am copying the bins out to /opt/bin rather than running the app inside the source folder directly. This seems a bit safer to ensure I am running a static build with less potential for unexpected side effects.
This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.