Use the ER from the canonical consensus chain when construct bundle #1871
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.
#1353 have discovered an issue that different consensus blocks may able to derive the exact same domain block, and because the
domain_hash
is used as the key to index ER, the operator may get an ER from non-canonical consensus chain when usingdomain_hash
to load ER and failed to submit to the consensus chain.#1363 tried to fix the issue by using
consensus_hash
to index the ER instead, however the issue still exists because the operator will use thedomain_hash => consensus_hash
mapping to get theconsensus_hash
bydomain_hash
first and then useconsensus_hash
to load ER, since the same domain block could still map to the consensus block of the non-canonical chain, it will still result in a wrong ER. Domain v2 using the same way to load ER thus this issue still existsThis PR tries to fix the issue completely by allowing a domain block can map to multiple consensus blocks, and only using the consensus block of the canonical chain to load ER. A test is also added in this PR, if pick the test to the main branch and run, it will fail due to
BuiltOnUnknownConsensusBlock
error.Code contributor checklist: