add support for SLH-DSA-SHA2-128s TXN authenticators#18300
Conversation
9d410f7 to
151124c
Compare
aptos-move/aptos-release-builder/src/components/feature_flags.rs
Outdated
Show resolved
Hide resolved
e21ba00 to
ec47db2
Compare
zjma
left a comment
There was a problem hiding this comment.
looks cool! (but I skipped folders ecosystem and protos...)
can we also have some API tests (though i'm not sure if there's a UT pattern to follow), or you have verified manually with a localnet?
Not sure what an API test is... can you point me to one? Also, don't the smoke tests act like an implicit API test? |
the current smoke test verified it works but you probably want more (e.g., when some serialization format changes, something should fail)? Something like the existing test case |
ec47db2 to
a5a91ed
Compare
JoshLind
left a comment
There was a problem hiding this comment.
Looks great! 😄 Still needs expert eyes on the VM side (i.e., gas logic and feature gating). Likewise, on the ecosystem side (e.g., protos and indexer).
But, otherwise, LGTM.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a2e4d8a to
e039d02
Compare
This reverts commit 865c61e.
e039d02 to
8b09ec9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
* initial authenticator for SLH-DSA-SHA2-128s * add API support for SLH-DSA-SHA2-128s * auto-generate API and protobuf files for SLH-DSA-SHA2-128s * add feature gating for SLH-DSA-SHA2-128s * added e2e smoke test for SLH-DSA-SHA2-128s accounts * add feature-gated higher gas costs for SLH-DSA-SHA128s transactions * lints and revert python/scripts/install_deps.sh * oops, should have appended to the enums * added API tests * incorporate gas feedback from victor * Partially-revert "incorporate gas feedback from victor" * oops, let's box things or risk OOM
Description
Builds on top of #18293 and adds support for the SLH-DSA-SHA2-128s as a secure post-quantum signature scheme for Aptos accounts.
This PR was split up nicely into 7 commits:
AccountAuthenticatorto support SLH-DSA-SHA2-128s...but, after some fixes, now totals 12 commits.
Boxfor the large SLH-DSA signature insideSingleKeyAuthenticatorTo run the smoke tests:
How Has This Been Tested?
testsuite/smoke-test/src/slh_dsa.rs.api/src/tests/slh_dsa_sha2_128s.rsKey Areas to Review
Feature flags & feature gating logic
New feature flag added in
types/src/on_chain_config/aptos_features.rsand mirrored in Move inaptos-move/framework/move-stdlib/sources/configs/features.move.Feature gating is done in
aptos-move/aptos-vm/src/aptos_vm.rs.Gas charging logic
Should ensure that feature gating was done right.
Was initially unsure what the semantics of
charge_slh_dsa_sha2_128sandcharge_keylessshould be in theAptosGasMeterimplementation for theGasProfiler. But talking to @vgao1996 cleared things up.TXN signature bureaucracy
It's been a while since we implemented a new TXN authenticator, so I do not recall all of the bureaucratic code changes that must be done.
Perhaps that should be reviewed?
Although, it looks like we are good & nothing is missing, since the e2e smoke test is succeeding which means serialized signatures are flowing through the network.
For transparency, here's the sequence of steps I took:
api/types/src/transaction.rscrates/aptos-transaction-filters/src/transaction_filter.rsecosystem/indexer-grpc/indexer-grpc-fullnode/src/convert.rsprotos/proto/aptos/transaction/v1/transaction.prototestsuite/generate-format/src/api.rstestsuite/generate-format/src/aptos.rstestsuite/generate-format/src/consensus.rsThen, I went to
protosand ran./scripts/install_deps.sh.Then, I ran
./scripts/authenticator_regenerate.sh, which failed inprotos/scripts/build_protos.shbecausepoetrywasn't working due to a missing dependencySo, I did a
pip install --break-system-packages --user certifi(yolo)Then, I re-tried
./scripts/authenticator_regenerate.sh, which now worked & did a lot of work:api/doc/spec.{yaml,json}filestestsuite/generate-format/tests/staged/*.yamlfilesprotos/Type of Change
Which Components or Systems Does This Change Impact?
Checklist
Note
Enables a new post-quantum signature scheme across the stack, behind a feature flag, with dedicated gas charging and full API/Indexer support.
slh_dsa__sha2_128sPublicKey/Signature variants andSlhDsa_Sha2_128stype; updates OpenAPI (spec.json/yaml) and protobufs (Rust/Python) and indexer gRPC conversionsSLH_DSA_SHA2_128S_SIGNATURE(107) gating; validates signatures, detectsis_slh_dsa_sha2_128sin metadata; charges new gas viacharge_slh_dsa_sha2_128sand includes it in intrinsic gas checksslh_dsa_sha2_128s.base, bumps gas feature version to V1_41; plumbs through meter traits, profiler, logs, flamegraph, and reportsAnyPublicKey/AnySignature, adds length checks; transaction filter updatedWritten by Cursor Bugbot for commit 8b09ec9. This will update automatically on new commits. Configure here.