-
Notifications
You must be signed in to change notification settings - Fork 2.6k
grandpa: avoid importing unnecessary justifications #14423
grandpa: avoid importing unnecessary justifications #14423
Conversation
This will solve the slow import issue when syncing with nodes that are sending more justifications as expected. However its a bit different than what we discussed earlier, correct? Since |
Another option could be to add another parameter in the (feel free to ignore... this is just an opinionated nit 😃) |
The |
I would probably go with the parameter, to make it configurable like we have for the creation. |
Updated to make the justification import period configurable. |
A dumb question: what if |
@jasl Both options will be used independently. |
So in our case, we could set |
@jasl Yes, that would work for your own node to generate as much justifications as possible while not affecting other nodes on the network, i.e. those nodes would ignore those justifications when doing initial sync. |
bot merge |
Error: Github API says paritytech/polkadot#7484 is not mergeable |
bot merge force |
* grandpa: avoid importing unnecessary justifications * grandpa: make justification_import_period configurable * grandpa: keep the first justification * grandpa: add test for justification import period * grandpa: fix test
* grandpa: avoid importing unnecessary justifications * grandpa: make justification_import_period configurable * grandpa: keep the first justification * grandpa: add test for justification import period * grandpa: fix test
* grandpa: avoid importing unnecessary justifications * grandpa: make justification_import_period configurable * grandpa: keep the first justification * grandpa: add test for justification import period * grandpa: fix test
This reverts commit 5056a99.
* grandpa: avoid importing unnecessary justifications * grandpa: make justification_import_period configurable * grandpa: keep the first justification * grandpa: add test for justification import period * grandpa: fix test
When importing a block if it includes a GRANDPA justification we will always process it. If a peer is serving us justifications for every block then we will invariably verify them and import them which can lead to a significant slowdown in block import speed. We don't need justifications for every block and therefore this is wasteful. After this PR we will only import GRANDPA justifications every 512 blocks (besides the mandatory ones, i.e. when authorities change).
Fixes problems like paritytech/polkadot-sdk#13.
polkadot companion: paritytech/polkadot#7484