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

chore(ckbtc): measure event migration instruction count #3721

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ninegua
Copy link
Member

@ninegua ninegua commented Feb 3, 2025

In #3434, empty events are being removed from events recorded in stable memory.

To be sure that this migration would succeed as part of the post_upgrade computation, its actual execution instruction counts needs to be measured.

@ninegua ninegua changed the base branch from master to paulliu/update-ckbtc-minter-event-logs February 3, 2025 06:26
@github-actions github-actions bot added the chore label Feb 3, 2025
@ninegua
Copy link
Member Author

ninegua commented Feb 3, 2025

Dumping stable memory succeeded, but canbench doesn't seem to work as intended when indicating that stable memory should be loaded from a file.

Alternatively we can call finish_upload manually after uploading all events, and this function returns the instruction count (and number of empty events removed) as a return value.

$ cargo test --test dump_stable_memory -- test_minter_event_upload_mainnet --show-output --nocapture
...
finish upload = (27765179443, Some(409141))
test test_minter_event_upload_mainnet ... ok

So the instruction count is around 27.7 billion for calling storage::migrate_old_events_if_not_empty.
If we instead measure the whole post_upgrade (after modifying finish_upload function), the result is:

$ cargo test --test dump_stable_memory -- test_minter_event_upload_mainnet --show-output --nocapture
...
finish upload = (31556020665,)
test test_minter_event_upload_mainnet ... ok

This is well below the instruction limit for post_upgrade, which is 300 billion at the moment.

Base automatically changed from paulliu/update-ckbtc-minter-event-logs to master February 6, 2025 00:07
@ninegua ninegua force-pushed the paulliu/ckbtc-replay-instruction-count branch from 9658672 to 945a543 Compare February 6, 2025 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant