This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
move paras inherent filtering to runtime #4028
Merged
Merged
Changes from 104 commits
Commits
Show all changes
112 commits
Select commit
Hold shift + click to select a range
87b6cde
move things around, add filter methods
drahnr bf1f98b
validator keys, modify availability bitfields according to disputes
drahnr 7c2711d
simplify, keep the filter -> sanitize generic for both usecases
drahnr 702bceb
minor
drahnr de29623
assure tests still work, reduce changeset
drahnr 98271ae
integration
drahnr f7003e8
start entropy passing
drahnr eb27dbb
fixins
drahnr 0e5d2ff
compile, 1 failing test
drahnr ceaefae
filter with coverage
drahnr 2f8385f
fixins
drahnr c169ae0
Update runtime/parachains/src/paras_inherent.rs
drahnr 623a283
slip of the pen
drahnr 9e1cb25
improve test cases
drahnr e0f4b9e
misc
drahnr 9ec43fa
fix
drahnr 8bd9af6
fixins
drahnr 2c23251
test avoid extra into() calls in assert_noop!
drahnr b815172
chores
drahnr 903382b
ff
drahnr 75b48eb
test fixup superfluous into call
drahnr 1c2b4de
chore: pfmt
drahnr c38771f
improve apply_block_weight_limit to try to maximize the number of suf…
drahnr 2908356
new code treats the lack of backed candidates as ok
drahnr 82617f2
Use vrf based entropy
drahnr 1b236a5
fixup vrf random
drahnr 56d2752
add warn
drahnr e11c985
slip of the pen
drahnr 4e13c1b
fixup
drahnr 7d00562
assure ordering
drahnr 4e06e8d
rethink apply_weights
drahnr 383711d
mock
drahnr bcd70eb
use a closure as predicate check
drahnr 84cbec3
extract and use DisputedBitfield
drahnr f347b3f
chore: simplify
drahnr 0df5cf4
remove stray dbg
drahnr 376d158
chore: fmt
drahnr 2d2f8a8
address feedback
drahnr a1a567c
fix test, halfway there
drahnr 64a759a
stage1
drahnr 98fb6d4
dbg stuff
drahnr 2085069
make group selection align
drahnr 2795af0
fix session index
drahnr 3271fd3
fix wrongly returned candidates
drahnr 4375b83
cleanup
drahnr cbed703
chore fmt
drahnr 88a7ee1
fix ensure check
drahnr a7332e0
make good case test work
drahnr 849af66
more tests for bitfields
drahnr bfa1f1a
create sanitize_backed_candidates
drahnr c2826a7
fixup tests
drahnr d2f03f4
update guide
drahnr 209e267
add check referenced in the guide
drahnr 03e77ad
improve weights code
drahnr 3b89d79
fmt
drahnr 20249dd
fixins
drahnr 57e8daa
Update roadmap/implementers-guide/src/runtime/inclusion.md
drahnr 352872b
compiling + address review
drahnr c592b48
add comments
drahnr 7dd4773
fix weight calc
drahnr 6cb7b8a
Merge remote-tracking branch 'origin/master' into bernhard-inherent-f…
drahnr ca447a8
address review comments and test failure
drahnr 7b75f7a
fix
drahnr d524b34
fix: condition
drahnr 0e637ae
Fix random_sel function
Lldenaurois 8113944
Fix overlength block check
Lldenaurois d290479
Merge remote-tracking branch 'parity/master' into bernhard-inherent-f…
Lldenaurois 9671728
Zeke + Ladi commit for disputes filtering + integration test builder …
Lldenaurois a8b4771
Add benchmarks for code upgrades
Lldenaurois 70feb6e
Code upgrade bench; Feature gate TestWeightInfo
emostov f861c2c
Try and make CI happier
emostov 35407fc
Feature gate enter test to not(benchmarks)
emostov 6c0c078
Make sure no unused imports/fn
emostov 0e88948
refactor, re-use, the beginning
drahnr aecdd96
Fix issue with frame benchmarking dep compilation
emostov ef35d97
More precise feature gating for some derives
emostov 4536741
integrate piece-wise
drahnr 5b1f1c0
foo
drahnr fa0de2e
fixins
drahnr 55a7f71
chore fmt
drahnr dac3b8e
fixins
drahnr 61db8a7
rename const generic
drahnr 80174ec
Merge branch 'bernhard-inherent-filtering2' into bernhard-inherent-fi…
emostov 7f1293b
Update runtime/parachains/src/paras_inherent.rs
drahnr 60a9be5
Fix compilation
bkchr e36e12a
limit to test
drahnr a2dcd20
remove unused spam slots
drahnr 9a9eb22
spellcheck
drahnr f1ef3e1
remove a tick, fix a typo
drahnr c9e5872
Add Code upgrade weights
Lldenaurois a7a835c
Merge remote-tracking branch 'parity/master' into bernhard-inherent-f…
Lldenaurois 8f1ad09
comment improvements + >=
drahnr 8ac5e56
remove another tick
drahnr ee89736
Update runtime/parachains/src/paras_inherent/benchmarking.rs
drahnr ca5cc54
saturating fixins + some spaces
drahnr c18e141
fix
drahnr ba34d06
benchmarking - preliminary results
drahnr f71e233
Add training wheels
Lldenaurois 8a42171
Refactor some early exit logic for enter
emostov ac0c325
Gracefully handle filtering bitfields & candidates (#4280)
emostov e566544
Refactor inherent data weight limiting logic (#4287)
emostov 62cda42
Apply suggestions from code review
emostov 933cba7
Update runtime/parachains/src/builder.rs
drahnr 2c85807
Update runtime/parachains/src/builder.rs
emostov 168ac98
Update runtime/parachains/src/paras_inherent.rs
emostov 2a0869b
final pass
drahnr 811f168
Run cargo +nightly-2021-10-29 fmt
emostov e12bc31
Update implementors guide with `sanitize_*` & `enter` (#4294)
emostov a52ffb7
Make spell check happier
emostov 53fcce5
Merge branch 'zeke-bernhard-inherent-filtering-go-green' into bernhar…
emostov 9e7eed5
Make wasm runtimes compile with benchmarks enabled (#4303)
emostov 3d760b6
Update weight files for runtime
emostov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ std = [ | |
"polkadot-core-primitives/std", | ||
"frame-support/std", | ||
] | ||
runtime-benchmarks = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,22 @@ OnChainVotes: Option<ScrapedOnChainVotes>, | |
1. Call `Scheduler::occupied` using the `occupied` core indices of the returned above, first sorting the list of assigned core indices. | ||
1. Call the `Ump::process_pending_upward_messages` routine to execute all messages in upward dispatch queues. | ||
1. If all of the above succeeds, set `Included` to `Some(())`. | ||
|
||
|
||
* `create_inherent`: This entry-point accepts one parameter: `InherentData`. | ||
1. Unpack `InherentData` into its parts, `bitfields`, `backed_candidates`, `disputes` and the `parent_header`. | ||
1. Hash the `parent_header` and make sure that it corresponds to the block hash of the parent (tracked by the `frame_system` FRAME module), | ||
1. Invoke `Disputes::filter_multi_dispute_data` to remove duplicates et al from `disputes`. | ||
1. Run the following within a `with_transaction` closure to avoid side effects: | ||
1. Invoke `Disputes::provide_multi_dispute_data`. | ||
1. Collect the newly concluded disputes as `current_concluded_invalid_disputes`. | ||
1. If there are any concluded disputes from the current session, invoke `Inclusion::collect_disputed` with the newly disputed candidates. Annotate each returned core with `FreedReason::Concluded`, sort them, and invoke `Scheduler::free_cores` with them. | ||
1. Collect the concluded invalid disputes in the current session as `conlcuded_invalid_disputes`. | ||
1. Return `TransactionOutcome::Rollback(freed_cores, concluded_invalid_disputes)`. | ||
1. Call `sanitize_bitfields<false>` and only use the sanitized set of bitfields afterwards. | ||
1. Call `sanitize_backed_candidates<false>`. | ||
1. Collect entropy based on `CurrentBlockRandomness::random`. | ||
1. Call `apply_weight_limit` to utilize the block as well as possible, with a randomized heuristic. | ||
1. Re-create a `InherentData` from the sanitized and weight bounded information. | ||
1. Call `Self::enter` which now should not error anymore, but we do this call anyways for now. | ||
1. Return `Call::enter { .. }`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unify this with the latest changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIXME this is a stub and needs some attention