This repository was 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.7k
Statement store #13701
Merged
Merged
Statement store #13701
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
729e524
WIP Statement store
arkpar 7591d22
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar ff1edaa
Sync with networking changes in master
arkpar 8407e40
WIP statement pallet
arkpar 21c9aaf
Statement validation
arkpar c706097
pallet tests
arkpar e066abe
Validation queue
arkpar bfbbc5b
Store maintenance
arkpar d36a867
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar d610e62
Basic statement refactoring + tests + docs
arkpar 0b73266
Store metrics
arkpar 66b9c98
Store tests
arkpar c8f0467
Store maintenance test
arkpar 9bc6773
cargo fmt
arkpar 8263aa4
Build fix
arkpar 7779458
OCW Api
arkpar f01160e
Offchain worker
arkpar 7431f55
Enable host functions
arkpar 5cc24b2
fmt
arkpar dea2dea
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 4febbea
Minor tweaks
arkpar b06e356
Fixed a warning
arkpar c6f2b53
Removed tracing
arkpar 50b583d
Manual expiration
arkpar e141eb7
Reworked constraint management
arkpar c5555e9
Updated pallet constraint calculation
arkpar 1171ba0
Added small test
arkpar 399cbbd
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 365e5e8
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 3d571ca
Added remove function to the APIs
arkpar 85a31c9
Copy-paste spec into readme
arkpar b07775f
Comments
arkpar 659b494
Made the store optional
arkpar 25f3771
Removed network protocol controller
arkpar 27e73cc
fmt
arkpar 39f0145
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 51b16ff
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 0e84775
Clippy fixes
arkpar 312a07e
fmt
arkpar 9c21172
fmt
arkpar 0d95b2e
More clippy fixes
arkpar 61f6e5f
More clippy fixes
arkpar d93493a
More clippy fixes
arkpar f06ac25
Update client/statement-store/README.md
arkpar 3c2373d
Apply suggestions from code review
arkpar a13e2c0
Removed sstore from node-template
arkpar ac499ab
Sort out data path
arkpar e562b65
Added offline check
arkpar 06f3376
Removed dispatch_statement
arkpar 167c4ad
Renamed into_generic
arkpar 4c840c0
Fixed commit placement
arkpar 03906c8
Use HashSet for tracking peers/statements
arkpar f33942c
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 206488d
fmt
arkpar 2625783
Use ExtendedHostFunctions
arkpar a7f652a
Fixed benches
arkpar 0bf748e
Tweaks
arkpar 8c883a7
Apply suggestions from code review
arkpar c05e3d7
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 6c15ce9
Fixed priority mixup
arkpar f383ab6
Rename
arkpar a978b2a
newtypes for priorities
arkpar 83f343f
Added MAX_TOPICS
arkpar 94b10a7
Fixed key filtering logic
arkpar 1c22fef
Remove empty entrie
arkpar f08810b
Removed prefix from signing
arkpar 7849cc8
More documentation
arkpar 64ac7f5
fmt
arkpar f05f5a3
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 21dd020
Moved store setup from sc-service to node
arkpar d72290c
Handle maintenance task in sc-statement-store
arkpar 16e469e
Use statement iterator
arkpar 8d18b5e
Renamed runtime API mod
arkpar 9d3add2
fmt
arkpar cd7c9dc
Remove dump_encoded
arkpar d29ebc7
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 38d893d
fmt
arkpar fdb43c5
Apply suggestions from code review
arkpar 74e4945
Apply suggestions from code review
arkpar 4f1ac76
Fixed build after applying review suggestions
arkpar 2f2d4f8
License exceptions
arkpar 75ee1bf
fmt
arkpar b501198
Store options
arkpar 692f58a
Moved pallet consts to config trait
arkpar 704d53a
Removed global priority
arkpar 71b39cf
Validate fields when decoding
arkpar a798b08
Limit validation channel size
arkpar 7af3b5a
Made a comment into module doc
arkpar 47a8e6b
Removed submit_encoded
arkpar 4fb2aee
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar df2df2a
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar f81511d
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar 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
Removed prefix from signing
- Loading branch information
commit f08810b5093b740ec6456d52ac77b8e2e57eaa59
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -194,7 +194,7 @@ impl Decode for Statement { | |
|
|
||
| impl Encode for Statement { | ||
| fn encode(&self) -> Vec<u8> { | ||
| self.encoded(true) | ||
| self.encoded(false) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -392,7 +392,7 @@ impl Statement { | |
|
|
||
| /// Return encoded fields that can be signed to construct or verify a proof | ||
| fn signature_material(&self) -> Vec<u8> { | ||
| self.encoded(false) | ||
| self.encoded(true) | ||
| } | ||
|
|
||
| /// Return a copy of this statement with proof removed | ||
|
|
@@ -433,21 +433,21 @@ impl Statement { | |
| self.data = Some(data) | ||
| } | ||
|
|
||
| fn encoded(&self, with_proof: bool) -> Vec<u8> { | ||
| fn encoded(&self, for_signing: bool) -> Vec<u8> { | ||
| // Encoding matches that of Vec<Field>. Basically this just means accepting that there | ||
| // will be a prefix of vector length. | ||
| let num_fields = if with_proof && self.proof.is_some() { 1 } else { 0 } + | ||
| let num_fields = if !for_signing && self.proof.is_some() { 1 } else { 0 } + | ||
| if self.decryption_key.is_some() { 1 } else { 0 } + | ||
| if self.priority.is_some() { 1 } else { 0 } + | ||
| if self.channel.is_some() { 1 } else { 0 } + | ||
| if self.data.is_some() { 1 } else { 0 } + | ||
| self.num_topics as u32; | ||
|
|
||
| let mut output = Vec::new(); | ||
| let compact_len = codec::Compact::<u32>(num_fields); | ||
| compact_len.encode_to(&mut output); | ||
| if !for_signing { | ||
| let compact_len = codec::Compact::<u32>(num_fields); | ||
| compact_len.encode_to(&mut output); | ||
|
Comment on lines
+480
to
+481
Member
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. Should also be documented somewhere that for signing we don't prefix the length.
Member
Author
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. It is document in the README. I'll add a comment here as well. |
||
|
|
||
| if with_proof { | ||
| if let Some(proof) = &self.proof { | ||
| 0u8.encode_to(&mut output); | ||
|
Contributor
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. Not sure if it is doable to use the "repr(u8)" of Field::Proof(_) here (probably not). |
||
| proof.encode_to(&mut output); | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.