aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[sdk] account recovery from derive path

Open stevenatcrypto opened this issue 3 years ago • 7 comments
trafficstars

Description

Close https://github.com/aptos-labs/aptos-core/issues/4089

Reference the previous TypeScript PR https://github.com/aptos-labs/aptos-core/pull/2073 and this code of Solana SDK (and dependency crate ed25519-dalek-bip32 and tiny-bip39).

Test Plan

Add an unit-test case test_recover_account_from_derive_path.


This change is Reviewable

stevenatcrypto avatar Sep 20 '22 07:09 stevenatcrypto

it would be good if you can cross-validate this with the TS SDK implementation.

jjleng avatar Sep 20 '22 07:09 jjleng

it would be good if you can cross-validate this with the TS SDK implementation.

@jjleng I added a test case test_recover_account_from_derive_path which uses the same validation values (mnemonics, derive path and expected address) with this test case of TypeScript.

I may misunderstand about cross-validate. Do you mean we should invoke TypeScript function to test? Could you help give some instruction? Thanks a lot.

stevenatcrypto avatar Sep 20 '22 07:09 stevenatcrypto

Forge is running suite land_blocking on 86f45782a27d80905edccff8324dea48e2afe937

github-actions[bot] avatar Oct 03 '22 06:10 github-actions[bot]

Forge is running suite compat on 843b204dce971d98449b82624f4f684c7a18b991 ==> 86f45782a27d80905edccff8324dea48e2afe937

github-actions[bot] avatar Oct 03 '22 06:10 github-actions[bot]

:x: Forge suite compat failure on 843b204dce971d98449b82624f4f684c7a18b991 ==> 86f45782a27d80905edccff8324dea48e2afe937

Compatibility test results for 843b204dce971d98449b82624f4f684c7a18b991 ==> 86f45782a27d80905edccff8324dea48e2afe937 (PR)
1. Check liveness of validators at old version: 843b204dce971d98449b82624f4f684c7a18b991
compatibility::simple-validator-upgrade::liveness-check : 7633 TPS, 4774 ms latency, 7000 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 86f45782a27d80905edccff8324dea48e2afe937
compatibility::simple-validator-upgrade::single-validator-upgrade : 5423 TPS, 7002 ms latency, 9400 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 86f45782a27d80905edccff8324dea48e2afe937
compatibility::simple-validator-upgrade::half-validator-upgrade : 6211 TPS, 5880 ms latency, 7700 ms p99 latency,no expired txns
4. upgrading second batch to new version: 86f45782a27d80905edccff8324dea48e2afe937
Test Failed: Retry due to pod aptos-node-2-validator-0 status
Trailing Log Lines:
Compatibility test results for 843b204dce971d98449b82624f4f684c7a18b991 ==> 86f45782a27d80905edccff8324dea48e2afe937 (PR)
1. Check liveness of validators at old version: 843b204dce971d98449b82624f4f684c7a18b991
compatibility::simple-validator-upgrade::liveness-check : 7633 TPS, 4774 ms latency, 7000 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 86f45782a27d80905edccff8324dea48e2afe937
compatibility::simple-validator-upgrade::single-validator-upgrade : 5423 TPS, 7002 ms latency, 9400 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 86f45782a27d80905edccff8324dea48e2afe937
compatibility::simple-validator-upgrade::half-validator-upgrade : 6211 TPS, 5880 ms latency, 7700 ms p99 latency,no expired txns
4. upgrading second batch to new version: 86f45782a27d80905edccff8324dea48e2afe937
Test Failed: Retry due to pod aptos-node-2-validator-0 status


Swarm logs can be found here: See fgi output for more information.
{"level":"INFO","source":{"package":"forge","file":"testsuite/forge/src/backend/k8s/cluster_helper.rs:280"},"thread_name":"main","hostname":"forge-compat-pr-4374-1664776930-843b204dce971d98449b82624f4f684","timestamp":"2022-10-03T06:16:30.554457Z","message":"Deleting namespace forge-compat-pr-4374: Some(NamespaceStatus { phase: Some(\"Terminating\") })"}
{"level":"INFO","source":{"package":"forge","file":"testsuite/forge/src/backend/k8s/cluster_helper.rs:388"},"thread_name":"main","hostname":"forge-compat-pr-4374-1664776930-843b204dce971d98449b82624f4f684","timestamp":"2022-10-03T06:16:30.554483Z","message":"aptos-node resources for Forge removed in namespace: forge-compat-pr-4374"}

failures:
    compatibility::simple-validator-upgrade

test result: FAILED. 0 passed; 1 failed; 0 filtered out
Failed to run tests:
Tests Failed

Error: Tests Failed
Debugging output:
NAME                                   READY   STATUS      RESTARTS   AGE
aptos-node-0-validator-0               1/1     Running     0          7m18s
aptos-node-1-validator-0               1/1     Running     0          9m29s
aptos-node-2-validator-0               0/1     Pending     0          5m6s
aptos-node-3-validator-0               1/1     Running     0          13m
aptos-node-4-validator-0               1/1     Running     0          13m
genesis-aptos-genesis-eforge34-mfs7f   0/1     Completed   0          13m

github-actions[bot] avatar Oct 03 '22 06:10 github-actions[bot]

:white_check_mark: Forge suite land_blocking success on 86f45782a27d80905edccff8324dea48e2afe937

performance benchmark with full nodes : 7718 TPS, 5142 ms latency, 7400 ms p99 latency,no expired txns
Test Ok

github-actions[bot] avatar Oct 03 '22 06:10 github-actions[bot]

Please rebase and we can get this landed.

davidiw avatar Oct 28 '22 16:10 davidiw

Delays are hard. Please try again. Hit me up on discord davidiw#1895 if you don't get a faster response next time.

davidiw avatar Dec 03 '22 20:12 davidiw

@davidiw Just rebased this PR 🙏

stevenatcrypto avatar Dec 04 '22 10:12 stevenatcrypto

Forge is running suite compat on testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 82379ccc26322f66be73ce941978b13432818490

github-actions[bot] avatar Dec 04 '22 13:12 github-actions[bot]

Forge is running suite land_blocking on 82379ccc26322f66be73ce941978b13432818490

github-actions[bot] avatar Dec 04 '22 13:12 github-actions[bot]

:white_check_mark: Forge suite land_blocking success on 82379ccc26322f66be73ce941978b13432818490

performance benchmark with full nodes : 6904 TPS, 5757 ms latency, 9900 ms p99 latency,no expired txns
Test Ok

github-actions[bot] avatar Dec 04 '22 13:12 github-actions[bot]

:white_check_mark: Forge suite compat success on testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 82379ccc26322f66be73ce941978b13432818490

Compatibility test results for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 82379ccc26322f66be73ce941978b13432818490 (PR)
1. Check liveness of validators at old version: testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7131 TPS, 5381 ms latency, 8200 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 82379ccc26322f66be73ce941978b13432818490
compatibility::simple-validator-upgrade::single-validator-upgrade : 4579 TPS, 8771 ms latency, 11400 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 82379ccc26322f66be73ce941978b13432818490
compatibility::simple-validator-upgrade::half-validator-upgrade : 5036 TPS, 8339 ms latency, 11000 ms p99 latency,no expired txns
4. upgrading second batch to new version: 82379ccc26322f66be73ce941978b13432818490
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6556 TPS, 5849 ms latency, 9200 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 82379ccc26322f66be73ce941978b13432818490 passed
Test Ok

github-actions[bot] avatar Dec 04 '22 13:12 github-actions[bot]