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 2.6k
Fix offchain election to respect the weight #7215
Merged
Merged
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
051d71e
Mockup
kianenigma 46686d6
Fix offchain election to respect the weight
kianenigma 649a6d6
Fix builds a bit
kianenigma ad19e02
Update frame/staking/src/offchain_election.rs
kianenigma 08aec98
Update frame/staking/src/offchain_election.rs
kianenigma a1feaf8
Make it build, binary search
kianenigma b7138f9
Merge branch 'kiz-staking-OCW-check-size' of github.com:paritytech/su…
kianenigma 2274196
Fix a number of grumbles
kianenigma 2572e4b
one more fix.
kianenigma 3f53149
remove unwrap.
kianenigma cc89113
better alg.
kianenigma a72069f
Better alg again.
kianenigma 8048e4f
Merge branch 'master' of github.com:paritytech/substrate into kiz-sta…
kianenigma 0e3c91f
Final fixes
kianenigma 47d69f7
Fix
kianenigma 86d24a3
Rollback to normal
kianenigma 0b618d4
Merge branch 'master' of github.com:paritytech/substrate into kiz-sta…
kianenigma 6b6ef3e
Final touches.
kianenigma addd535
Better tests.
kianenigma e11ab9d
Update frame/staking/src/lib.rs
kianenigma f1d9f2b
Proper maxExtWeight
kianenigma 4573d36
Merge branch 'kiz-staking-OCW-check-size' of github.com:paritytech/su…
kianenigma a1ef1b4
Merge branch 'master' of github.com:paritytech/substrate into kiz-sta…
kianenigma 43b149c
Final fix
kianenigma 3ff8c0a
Final fix for the find_voter
kianenigma 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
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 |
---|---|---|
|
@@ -22,3 +22,4 @@ rls*.log | |
**/hfuzz_target/ | ||
**/hfuzz_workspace/ | ||
.cargo/ | ||
.cargo-remote.toml |
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
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.
This is supposed to be the "largest" extrinsic possible, but doesnt take into account weight introduced by on_initialize. Is that an issue?
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.
It seems you may be better off querying the current block weight as registered in System and using that to determine how much space you can fill?
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.
Indeed the intention is to be the big boy here, generate the largest possible extrinsic. Because this is now operational, it is fine even if we have someon_initialize
weight in the block, as long asaverage_on_initialize < operational_size
. Seeoperational_works_on_full_block
incheck_weight.rs
Yes, the on_initialize is an issue.
maybe... But there are flaws to this as well:
N
and validated later for authoring againstN + 1
orN + 2
or.. so this is a good hint, but not accurate.