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

External Index handling as sent by external chain #836

Merged
merged 26 commits into from
Jan 31, 2025

Conversation

girazoki
Copy link
Contributor

@girazoki girazoki commented Jan 29, 2025

Adds handling of the epoch sent externally as part of the validators. this is used later to pinpoint reward and slashes to a certain point in time. As part of this PR we do:

  • store the external index (which can be an epoch/timestamp/set_id or in general whatever you want that acts as an indetifier for the validators sent at a given point in time) per era. Everytime we receive one we put it in storage item called ExternalIndex. Before the era start, we put this in PendingExternalIndex. At the era start, we put it in CurrentExternalIndex.

  • on_era_start now sends this timestamp over. The goal is that pallet-external-validator-slashes stores this information in BondedEras. As this is the information later used to pinpoint slahes, we use it to pinpoint a particular slash to a external index.

  • externalValidatorsRewards now sends CurrentExternalndex as part of the rewards message.

  • Includes a migration to migrate currently bonded eras

To verify it works with try-runtime: try-runtime --runtime target/release/wbuild/dancelight-runtime/dancelight_runtime.compact.compressed.wasm on-runtime-upgrade live --uri wss://stagelight.tanssi-dev.network:443 --pallet ExternalValidatorSlashes --pallet CollatorConfiguration --pallet Balances --pallet Migrations --pallet Configuration

Copy link
Contributor

github-actions bot commented Jan 29, 2025

WASM runtime size check:

Compared to target branch

dancebox runtime: 1412 KB (no changes) ✅

flashbox runtime: 824 KB (no changes) ✅

dancelight runtime: 2172 KB (no changes) ✅

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

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

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Coverage Report

(master)

@@                         Coverage Diff                         @@
##           master   girazoki-add-timestamp-handling      +/-   ##
===================================================================
+ Coverage   66.01%                            66.04%   +0.03%     
  Files         335                               335              
+ Lines       58789                             58858      +69     
===================================================================
+ Hits        38809                             38869      +60     
+ Misses      19980                             19989       +9     
Files Changed Coverage
/chains/orchestrator-paras/runtime/common/src/migrations.rs 85.56% (-0.67%)
/chains/orchestrator-relays/runtime/dancelight/src/lib.rs 68.61% (-0.17%)
/chains/orchestrator-relays/runtime/dancelight/src/tests/migrations_test.rs 99.04% (+1.57%)
/pallets/external-validator-slashes/src/lib.rs 86.25% (+0.22%)
/pallets/external-validators/src/lib.rs 90.85% (+0.41%)
/primitives/bridge/src/symbiotic_message_processor.rs 93.55% (+0.69%)

Coverage generated Fri Jan 31 18:12:41 UTC 2025

@girazoki girazoki marked this pull request as ready for review January 30, 2025 17:15
@girazoki girazoki added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. breaking Needs to be mentioned in breaking changes labels Jan 31, 2025
@girazoki girazoki changed the title timestamp handling as sent externally External Index handling as sent by external chain Jan 31, 2025
@girazoki girazoki merged commit 8ca9120 into master Jan 31, 2025
44 checks passed
@girazoki girazoki deleted the girazoki-add-timestamp-handling branch January 31, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants