-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat: batch transactions import #1349
Merged
Merged
Changes from all commits
Commits
Show all changes
103 commits
Select commit
Hold shift + click to select a range
6ff5c66
Update dependent costs in schema
bvrooman fc28088
Fix whitespace
bvrooman 1801d8a
Update CHANGELOG.md
bvrooman 1fc2c59
Merge branch 'master' into bvrooman/fix/update-dependent-cost-schema
bvrooman d5908e0
Update CHANGELOG.md
bvrooman a3cd09c
Revert "Update CHANGELOG.md"
bvrooman c51fb6f
Merge branch 'master' into bvrooman/fix/update-dependent-cost-schema
1ce767a
Refactoring
bvrooman 0869dec
WIP
bvrooman 250e19c
Migrate to canonical serialization
bvrooman 5c4b85b
Migrate to canonical serialization
bvrooman 0f2b81f
Update snapshots
bvrooman d6fcfac
Update chainspecs with dummy costs
bvrooman 052fcf2
Merge branch 'bvrooman/fix/update-dependent-cost-schema' into bvrooma…
bvrooman b913c45
Merge branch 'master' into bvrooman/feat/batch-transactions-import
bvrooman 5edbf53
WIP
bvrooman e33c070
WIP
bvrooman e47349c
WIP
bvrooman 1722699
WIP
bvrooman f96ea14
WIP
bvrooman a010f4f
Merge branch 'master' into bvrooman/feat/batch-transactions-import
f5e695f
WIP
bvrooman 347b15e
Update tests.rs
bvrooman d103e0f
WIP Tests
bvrooman 2e4bdeb
WIP
bvrooman b0e495a
WIP
bvrooman 0fd4500
WIP
bvrooman 6bb319e
Update import.rs
bvrooman 95764ba
WIP
bvrooman 7bfa573
Update tests.rs
bvrooman b4266bb
WIP
bvrooman 84001cc
WIP
bvrooman cec91d8
Update import.rs
bvrooman f58defe
Update tests.rs
bvrooman 00a682f
WIP
bvrooman 80ab2dc
WIP
bvrooman 90c87b0
WIP
bvrooman 02b5a00
WIP
bvrooman 433c033
WIP
bvrooman 8203611
WIP
bvrooman 6115eb2
All tests passing
bvrooman 2865aed
Merge branch 'master' into bvrooman/feat/batch-transactions-import
bvrooman 7723dbb
Merge branch 'master' into bvrooman/feat/batch-transactions-import
3ab36c5
Update CHANGELOG.md
bvrooman 620e215
Merge branch 'master' into bvrooman/feat/batch-transactions-import
63abe76
Update
bvrooman 62e4f78
Merge branch 'bvrooman/feat/batch-transactions-import' of https://git…
bvrooman d3b517f
Clean up
bvrooman be2c6e2
WIP
bvrooman ae2bbc7
Update import.rs
bvrooman a2bdcff
WIP
bvrooman 8f17f5c
WIP
bvrooman 117da4a
WIP
bvrooman 32b4baf
Rename TransactionData to Transactions
bvrooman 713ce61
Merge branch 'master' into bvrooman/feat/batch-transactions-import
497e48c
Update service.rs
bvrooman 79573f3
Minor
bvrooman 69df941
Clippy
bvrooman 76b475e
Update sync.rs
bvrooman 4c129d3
Fix import tests
bvrooman 7ee4304
Tests WIP
bvrooman 4db827d
Serialization WIP
bvrooman d377593
Update postcard.rs
bvrooman 6483a32
Integration tests passing
bvrooman 5c72d46
Use range instead of blockids
bvrooman cc3426d
Merge branch 'master' into bvrooman/feat/batch-transactions-import
bvrooman 94fd510
Update sealed_block.rs
bvrooman 1c312b2
Merge branch 'master' into bvrooman/feat/batch-transactions-import
428b712
Remove dbg
bvrooman 6d65b0c
Remove dbg
bvrooman 5dceeec
References instead of clone
bvrooman 835f823
Something
xgreenx d002c53
Batch
bvrooman 90e4ab6
Clippy says implicit lifetimes
bvrooman 7e2eef0
Clean up
bvrooman 8a7a65a
More clippy
bvrooman 721a098
Minor
bvrooman 33e76fd
Merge branch 'master' into bvrooman/feat/batch-transactions-import
72ef01e
Minor
bvrooman 61bf616
Merge branch 'bvrooman/feat/batch-transactions-import' of https://git…
bvrooman f3d7a3b
Minor
bvrooman 5798cbc
Instrument
bvrooman af2d696
Import tests passing
bvrooman aa63098
All tests passing
bvrooman 3a656d3
Clean up
bvrooman cfd3006
Restore random peer id from header request
bvrooman c0b4d1b
WIP
bvrooman d782a8a
Clean up
bvrooman c49c1c9
Clean up
bvrooman 45b8376
Clean up
bvrooman e60a1cd
Clean up
bvrooman 895a7c9
Clean up
bvrooman bde0022
Update test
bvrooman b6c8241
Rename
bvrooman 07962aa
Clean up
bvrooman 4ed6aef
Remove redundant test
bvrooman 0a035ed
Parameterize tests + additional test
bvrooman 59cc41c
Fix comment
bvrooman d5167be
Fix
bvrooman 09bc753
Remove `Result` from streams and use `Batch::is_err` (#1391)
xgreenx ad477ca
Merge branch 'master' into bvrooman/feat/batch-transactions-import
xgreenx be48776
Merge branch 'master' into bvrooman/feat/batch-transactions-import
xgreenx 4e40e15
Review feedback
bvrooman 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
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
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.
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.
Idk if this is a helpful question, but why aren't we just getting the blocks directly rather than the headers + txs separately in the
import
code? I can't think of what requirement we have to do them separate, but very possible I'm just forgetting something.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.
The block itself can be very huge while being invalid at the same time because the header is invalid(the block producer or consensus did not sign it).
Requesting headers first ensures that at least this header(and a related block to it) was created according to the rules. It helps to identify potential forks and prevent DoS vectors. Punishment for sending the wrong header should be less than sending an invalid transaction related to this header because, in the second case, it is a malicious move, while invalid headers are not so problematic or may be related to the fork or misconfiguration.
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.
I think it's a fair question. During the import, we require a few checks for data integrity. Some of those include:
If any of these checks fail for a given header, then the block is invalid, and we don't want to execute it. A failure could mean that the data is corrupt or the peer is acting maliciously.
If we didn't need any of these checks, it is conceivable that we could execute and commit a block immediately. In that case, we would just download the block for execution. But these checks mitigate the consequences of adversarial behaviour.
Let me know if that answers your question satisfactorily.