Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keyless to rust sdk and txn-emitter #12976

Merged
merged 29 commits into from
Oct 1, 2024
Merged

Add keyless to rust sdk and txn-emitter #12976

merged 29 commits into from
Oct 1, 2024

Conversation

heliuchuan
Copy link
Contributor

@heliuchuan heliuchuan commented Apr 22, 2024

Description

This implements a bare sdk for Keyless (no pepper/proof fetching) and adds the ability to use keyless accounts for the txn-emitter.

The emitter requires a proof file which contains serialized ZeroKnowledgeSignatures.

The following args are added to specify the proper parameters for accounts generation

    #[clap(long, value_parser = ConfigKey::<Ed25519PrivateKey>::from_encoded_string, requires = "proof_file_path", requires = "keyless_jwt")]
    pub keyless_ephem_secret_key: Option<ConfigKey<Ed25519PrivateKey>>,

    #[clap(long)]
    pub proof_file_path: Option<String>,

    #[clap(long, default_value_t = 2700000000)]
    pub epk_expiry_date_secs: u64,

    #[clap(long)]
    pub keyless_jwt: Option<String>,

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Other (specify)

How Has This Been Tested?

Key Areas to Review

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Apr 22, 2024

⏱️ 2h total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-targeted-unit-tests 46m 🟩🟩
rust-move-tests 28m 🟩🟩
rust-lints 17m 🟩🟩
run-tests-main-branch 14m 🟩🟩🟩
general-lints 6m 🟩🟩🟩
check-dynamic-deps 6m 🟩🟩🟩
semgrep/ci 1m 🟩🟩🟩
file_change_determinator 33s 🟩🟩🟩
file_change_determinator 31s 🟩🟩🟩
permission-check 10s 🟩🟩🟩
permission-check 8s 🟩🟩🟩
permission-check 8s 🟩🟩🟩
permission-check 7s 🟩🟩🟩

🚨 1 job on the last run was significantly faster/slower than expected

Job Duration vs 7d avg Delta
rust-targeted-unit-tests 22m 15m +48%

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor

github-actions bot commented Jun 7, 2024

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Jun 7, 2024
@heliuchuan heliuchuan marked this pull request as ready for review June 17, 2024 22:29
@heliuchuan heliuchuan requested a review from alinush as a code owner June 17, 2024 22:29
@github-actions github-actions bot removed the Stale label Jun 18, 2024
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Aug 17, 2024
@github-actions github-actions bot closed this Sep 1, 2024
@heliuchuan heliuchuan reopened this Sep 19, 2024
@github-actions github-actions bot removed the Stale label Sep 20, 2024
@heliuchuan heliuchuan changed the title Add smoke test using keyless rust sdk Add keyless to rust sdk and txn-emitter Sep 26, 2024
@igor-aptos igor-aptos self-requested a review September 26, 2024 22:53
sdk/src/types.rs Show resolved Hide resolved
sdk/src/types.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@zjma zjma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-approved, assuming test_proofs_for_localnet_txn_emitter.txt will be populated to pass the updated tests.

Copy link
Contributor

@igor-aptos igor-aptos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks looks great! minor config cleanup, and this is ready!

crates/transaction-emitter-lib/src/args.rs Outdated Show resolved Hide resolved
crates/transaction-emitter-lib/src/args.rs Show resolved Hide resolved
@heliuchuan heliuchuan requested a review from igor-aptos October 1, 2024 00:03
@heliuchuan heliuchuan enabled auto-merge (squash) October 1, 2024 11:15

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Oct 1, 2024

✅ Forge suite compat success on 7ef01a26f8d8a38610e3d364b722df517c970749 ==> 8347903991a22552e780888ebc1c3cf2dc80b508

Compatibility test results for 7ef01a26f8d8a38610e3d364b722df517c970749 ==> 8347903991a22552e780888ebc1c3cf2dc80b508 (PR)
1. Check liveness of validators at old version: 7ef01a26f8d8a38610e3d364b722df517c970749
compatibility::simple-validator-upgrade::liveness-check : committed: 9551.29 txn/s, latency: 2899.15 ms, (p50: 1800 ms, p70: 2100, p90: 3300 ms, p99: 36900 ms), latency samples: 471620
2. Upgrading first Validator to new version: 8347903991a22552e780888ebc1c3cf2dc80b508
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 7536.98 txn/s, latency: 3657.39 ms, (p50: 4000 ms, p70: 4500, p90: 4900 ms, p99: 5100 ms), latency samples: 136860
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6992.56 txn/s, latency: 4600.80 ms, (p50: 4800 ms, p70: 5000, p90: 6600 ms, p99: 7000 ms), latency samples: 230800
3. Upgrading rest of first batch to new version: 8347903991a22552e780888ebc1c3cf2dc80b508
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 6360.02 txn/s, latency: 4392.38 ms, (p50: 4800 ms, p70: 5000, p90: 6000 ms, p99: 6200 ms), latency samples: 130220
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 7040.43 txn/s, latency: 4580.88 ms, (p50: 4700 ms, p70: 4900, p90: 6600 ms, p99: 7000 ms), latency samples: 240400
4. upgrading second batch to new version: 8347903991a22552e780888ebc1c3cf2dc80b508
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 6375.42 txn/s, latency: 4238.48 ms, (p50: 3400 ms, p70: 5400, p90: 7900 ms, p99: 8300 ms), latency samples: 119220
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 7055.26 txn/s, latency: 4174.94 ms, (p50: 3100 ms, p70: 4100, p90: 10900 ms, p99: 12500 ms), latency samples: 275460
5. check swarm health
Compatibility test for 7ef01a26f8d8a38610e3d364b722df517c970749 ==> 8347903991a22552e780888ebc1c3cf2dc80b508 passed
Test Ok

Copy link
Contributor

github-actions bot commented Oct 1, 2024

✅ Forge suite realistic_env_max_load success on 8347903991a22552e780888ebc1c3cf2dc80b508

two traffics test: inner traffic : committed: 11851.13 txn/s, latency: 3357.96 ms, (p50: 3300 ms, p70: 3300, p90: 3600 ms, p99: 4800 ms), latency samples: 4506060
two traffics test : committed: 100.06 txn/s, latency: 1815.19 ms, (p50: 1600 ms, p70: 1700, p90: 2800 ms, p99: 8400 ms), latency samples: 1820
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.249, avg: 0.227", "QsPosToProposal: max: 1.595, avg: 1.375", "ConsensusProposalToOrdered: max: 0.337, avg: 0.330", "ConsensusOrderedToCommit: max: 0.488, avg: 0.472", "ConsensusProposalToCommit: max: 0.819, avg: 0.801"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 1.42s no progress at version 42775 (avg 0.24s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 7.11s no progress at version 1797872 (avg 6.28s) [limit 15].
Test Ok

Copy link
Contributor

github-actions bot commented Oct 1, 2024

✅ Forge suite framework_upgrade success on 7ef01a26f8d8a38610e3d364b722df517c970749 ==> 8347903991a22552e780888ebc1c3cf2dc80b508

Compatibility test results for 7ef01a26f8d8a38610e3d364b722df517c970749 ==> 8347903991a22552e780888ebc1c3cf2dc80b508 (PR)
Upgrade the nodes to version: 8347903991a22552e780888ebc1c3cf2dc80b508
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1197.06 txn/s, submitted: 1200.03 txn/s, failed submission: 2.97 txn/s, expired: 2.97 txn/s, latency: 2507.84 ms, (p50: 2400 ms, p70: 2700, p90: 3900 ms, p99: 5500 ms), latency samples: 104780
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1205.93 txn/s, submitted: 1207.53 txn/s, failed submission: 1.60 txn/s, expired: 1.60 txn/s, latency: 2572.36 ms, (p50: 2400 ms, p70: 2700, p90: 3900 ms, p99: 5400 ms), latency samples: 105580
5. check swarm health
Compatibility test for 7ef01a26f8d8a38610e3d364b722df517c970749 ==> 8347903991a22552e780888ebc1c3cf2dc80b508 passed
Upgrade the remaining nodes to version: 8347903991a22552e780888ebc1c3cf2dc80b508
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1326.01 txn/s, submitted: 1327.52 txn/s, failed submission: 1.51 txn/s, expired: 1.51 txn/s, latency: 2548.18 ms, (p50: 2400 ms, p70: 2700, p90: 3900 ms, p99: 6000 ms), latency samples: 105620
Test Ok

@heliuchuan heliuchuan merged commit d10449d into main Oct 1, 2024
47 checks passed
@heliuchuan heliuchuan deleted the keyless-sdk-smoke branch October 1, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants