Add safe
and finalized
block tags support
#853
Merged
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.
Adds
Safe
andFinalized
variants toBlockNumber
, being currently introduced as part of the Merge. This expands the already existing support forearliest
,pending
andlatest
.In the Merge there is a difference between what's considered a
safe
finality checkpoint, and thefinalized
checkpoint, being the later the one we can assume is very unlikely to be re-orged.In Polkadot - and this applies for parachains and for PoS substrate-based chains - a block is considered finalized once enough validators agreed on it, so I added
safe
checkpoint mostly as an alias tofinalized
and for both we useBlockchainInfo::finalized_hash
.Note: also bumped
web3
library to the most recent release candidate version which includes support for this tags.