-
Notifications
You must be signed in to change notification settings - Fork 454
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
Bulk syncing of missing BlockMetadata #2765
base: bulk-blockmetadata-api
Are you sure you want to change the base?
Bulk syncing of missing BlockMetadata #2765
Conversation
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.
Nice :)
arbnode/blockmetadata.go
Outdated
}, nil | ||
} | ||
|
||
func (b *BlockMetadataRebuilder) Fetch(ctx context.Context, fromBlock, toBlock uint64) ([]gethexec.NumberAndBlockMetadata, error) { |
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.
nitpick: why to export this func?
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 main reason was to enable testing of each components separately (which was done and later replaced with a system test).
But there really is no preference for me here, can always export these functions later if needed- going to make these private now
arbnode/blockmetadata.go
Outdated
return ret | ||
} | ||
|
||
func (b *BlockMetadataRebuilder) PersistBlockMetadata(query []uint64, result []gethexec.NumberAndBlockMetadata) error { |
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.
nitpick: why to export this func?
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.
LGTM
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.
LGTM
…d locally computed hash
This PR introduces
BlockMetadataRebuilder
that can be configured via config options--node.block-metadata-rebuilder.*
that when enabled will check, in regular intervals, for missing blockMetadata in ArbDB and fetch those in bulk from an endpoint servicingarb_getRawBlockMetadata
method introduced here and adds them to ArbDB.Resolves NIT-2838