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

Benchmark slashes queue processing #801

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

nanocryk
Copy link
Contributor

@nanocryk nanocryk commented Jan 9, 2025

Change the function signature of process_slashes_queue to take the limit as argument, which helps benchmarking it. It also now returns the number of slashes processed to return the actually used weight.

Following suggestion in #793, I only read and write from storage once by moving the for loop inside the mutate call.

Copy link
Contributor

github-actions bot commented Jan 9, 2025

WASM runtime size check:

Compared to target branch

dancebox runtime: 1416 KB (no changes) ✅

flashbox runtime: 824 KB (no changes) ✅

dancelight runtime: 2148 KB (no changes) ✅

container chain template simple runtime: 1124 KB (no changes) ✅

container chain template frontier runtime: 1400 KB (no changes) ✅

@nanocryk nanocryk force-pushed the jeremy-bench-slashes branch from 3396ba9 to 87103ab Compare January 9, 2025 15:16
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Coverage Report

(master)

@@                          Coverage Diff                          @@
##           agustin-map-slashes   jeremy-bench-slashes      +/-   ##
=====================================================================
+ Coverage                65.15%                 65.74%   +0.59%     
- Files                      330                    329       -1     
+ Lines                    57796                  58109     +313     
=====================================================================
+ Hits                     37655                  38202     +547     
- Misses                   20141                  19907     -234     
Files Changed Coverage
/chains/orchestrator-relays/runtime/dancelight/src/lib.rs 68.25% (+0.65%)
/chains/orchestrator-relays/runtime/dancelight/src/tests/slashes.rs 98.85% (-1.15%)
/chains/orchestrator-relays/runtime/dancelight/src/weights/pallet_external_validator_slashes.rs 30.77% (+30.77%)
/chains/orchestrator-relays/runtime/dancelight/src/weights/pallet_message_queue.rs 59.55% (+59.55%)
/chains/orchestrator-relays/runtime/dancelight/src/weights/runtime_common_paras_registrar.rs 0.00% (-13.64%)
/chains/orchestrator-relays/runtime/dancelight/src/weights/snowbridge_pallet_outbound_queue.rs 33.33% (+33.33%)
/pallets/external-validator-slashes/src/lib.rs 78.57% (+3.86%)
/pallets/external-validator-slashes/src/weights.rs 14.63% (+14.63%)
/primitives/bridge/src/custom_do_process_message.rs 96.20% (+96.20%)
/primitives/bridge/src/lib.rs 80.45% (+22.65%)

Coverage generated Fri Jan 10 12:13:25 UTC 2025

Copy link
Contributor

@girazoki girazoki left a comment

Choose a reason for hiding this comment

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

good job jeremy

@nanocryk nanocryk merged commit b7d4bd8 into agustin-map-slashes Jan 10, 2025
34 of 42 checks passed
@nanocryk nanocryk deleted the jeremy-bench-slashes branch January 10, 2025 14:02
Agusrodri added a commit that referenced this pull request Jan 20, 2025
* first approach

* start adding on_era_end to ExternalValidatorSlashes

* add timestamp for era

* send slashes once they are confirmed

* apply slashes next era

* first test sending messages

* modify more tests

* more tests

* more tests for jeremy

* fix tests

* Simplify slashes queue processing (#800)

* simplify slash process queue and process a page every block

* on process page in on_initialize

* fix one test

* first integrationt test working

* more tests

* slashes

* test we are sending message to eth

* new integration test

* slashes are accumulated across eras

* cleanup some tests

* zepter

* lint

* fmt

* Benchmark slashes queue processing (#801)

* optimize storage writes and prepare bench

* run bench locally

* fmt

* ts-api

* toml-maid

* fix clippy

* add test for account_id encoding

* add SlashesMessageSent event and tests

* fmt

* api-augment

* use FixedBytes token for the slash account

* pr comments

* mock optimization

* add test for invulnerables grandpa slashing

* fix docs

* api-augment

---------

Co-authored-by: girazoki <gorka.irazoki@gmail.com>
Co-authored-by: nanocryk <6422796+nanocryk@users.noreply.github.com>
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.

2 participants