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

[Aptos-framework] Add a public function to emit a new block event

Open runtian-zhou opened this issue 2 years ago • 2 comments

Description

Add a public function to emit a new block event. This is needed for #4037 . The reason is that a genesis writeset will need both a new block event and a new epoch event for it to be committed. As of now, there's no way to emit this new block event which thus prevented any WriteSet scripts to be executed and committed.

Test Plan

Tested this change along side with #4172 by manually pinning the git version to this commit here. Once this PR lands we will be able to run the test in #4172 again and enable the testing there.


This change is Reviewable

runtian-zhou avatar Sep 13 '22 22:09 runtian-zhou

Change the PR to use the timestamp from the block. Also changed to use emit_event directly as emit_new_block_event will invoke update_global_time and would fail as this expect a vm signer.

runtian-zhou avatar Sep 14 '22 00:09 runtian-zhou

Forge is running suite compat on testnet ==> e781860cc7f7954e921ade3fb395248b0340ba2d

Forge is running suite land_blocking on e781860cc7f7954e921ade3fb395248b0340ba2d

:white_check_mark: Forge suite compat success on testnet ==> e781860cc7f7954e921ade3fb395248b0340ba2d

Compatibility test results for testnet ==> e781860cc7f7954e921ade3fb395248b0340ba2d (PR)
1. Check liveness of validators at old version: testnet
compatibility::simple-validator-upgrade::liveness-check : 7594 TPS, 4848 ms latency, 6900 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: e781860cc7f7954e921ade3fb395248b0340ba2d
compatibility::simple-validator-upgrade::single-validator-upgrade : 6066 TPS, 6210 ms latency, 7300 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: e781860cc7f7954e921ade3fb395248b0340ba2d
compatibility::simple-validator-upgrade::half-validator-upgrade : 5425 TPS, 6979 ms latency, 9900 ms p99 latency,no expired txns
4. upgrading second batch to new version: e781860cc7f7954e921ade3fb395248b0340ba2d
compatibility::simple-validator-upgrade::rest-validator-upgrade : 7882 TPS, 4708 ms latency, 8800 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet ==> e781860cc7f7954e921ade3fb395248b0340ba2d passed
Test Ok

:white_check_mark: Forge suite land_blocking success on e781860cc7f7954e921ade3fb395248b0340ba2d

performance benchmark with full nodes : 8076 TPS, 4918 ms latency, 6900 ms p99 latency,no expired txns
Test Ok

Forge is running suite land_blocking on 926648d74d741fcd10f6606c50ad0113a778858d

Forge is running suite compat on testnet ==> 926648d74d741fcd10f6606c50ad0113a778858d

:white_check_mark: Forge suite compat success on testnet ==> 926648d74d741fcd10f6606c50ad0113a778858d

Compatibility test results for testnet ==> 926648d74d741fcd10f6606c50ad0113a778858d (PR)
1. Check liveness of validators at old version: testnet
compatibility::simple-validator-upgrade::liveness-check : 8339 TPS, 4448 ms latency, 6100 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 926648d74d741fcd10f6606c50ad0113a778858d
compatibility::simple-validator-upgrade::single-validator-upgrade : 5707 TPS, 6479 ms latency, 8900 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 926648d74d741fcd10f6606c50ad0113a778858d
compatibility::simple-validator-upgrade::half-validator-upgrade : 6031 TPS, 6122 ms latency, 8300 ms p99 latency,no expired txns
4. upgrading second batch to new version: 926648d74d741fcd10f6606c50ad0113a778858d
compatibility::simple-validator-upgrade::rest-validator-upgrade : 7577 TPS, 4643 ms latency, 7500 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet ==> 926648d74d741fcd10f6606c50ad0113a778858d passed
Test Ok

:white_check_mark: Forge suite land_blocking success on 926648d74d741fcd10f6606c50ad0113a778858d

performance benchmark with full nodes : 8162 TPS, 4856 ms latency, 6900 ms p99 latency,no expired txns
Test Ok

github-actions[bot] avatar Sep 14 '22 21:09 github-actions[bot]