Skip to content
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

Open
wants to merge 11 commits into
base: bulk-blockmetadata-api
Choose a base branch
from

Conversation

ganeshvanahalli
Copy link
Contributor

@ganeshvanahalli ganeshvanahalli commented Nov 1, 2024

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 servicing arb_getRawBlockMetadata method introduced here and adds them to ArbDB.

Resolves NIT-2838

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Nov 1, 2024
@ganeshvanahalli ganeshvanahalli changed the base branch from master to bulk-blockmetadata-api November 1, 2024 15:11
@ganeshvanahalli ganeshvanahalli changed the title Bulksyncing missing blockmetadata Bulk syncing of missing BlockMetadata Nov 6, 2024
@ganeshvanahalli ganeshvanahalli marked this pull request as ready for review November 6, 2024 11:52
arbnode/blockmetadata.go Outdated Show resolved Hide resolved
system_tests/timeboost_test.go Outdated Show resolved Hide resolved
arbnode/schema.go Outdated Show resolved Hide resolved
arbnode/blockmetadata.go Outdated Show resolved Hide resolved
arbnode/blockmetadata.go Outdated Show resolved Hide resolved
arbnode/transaction_streamer.go Outdated Show resolved Hide resolved
arbnode/blockmetadata.go Show resolved Hide resolved
system_tests/timeboost_test.go Outdated Show resolved Hide resolved
system_tests/timeboost_test.go Outdated Show resolved Hide resolved
arbnode/blockmetadata.go Outdated Show resolved Hide resolved
Copy link
Contributor

@diegoximenes diegoximenes left a 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 Show resolved Hide resolved
arbnode/blockmetadata.go Outdated Show resolved Hide resolved
arbnode/blockmetadata.go Outdated Show resolved Hide resolved
}, nil
}

func (b *BlockMetadataRebuilder) Fetch(ctx context.Context, fromBlock, toBlock uint64) ([]gethexec.NumberAndBlockMetadata, error) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

return ret
}

func (b *BlockMetadataRebuilder) PersistBlockMetadata(query []uint64, result []gethexec.NumberAndBlockMetadata) error {
Copy link
Contributor

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?

system_tests/timeboost_test.go Outdated Show resolved Hide resolved
system_tests/timeboost_test.go Outdated Show resolved Hide resolved
system_tests/timeboost_test.go Show resolved Hide resolved
system_tests/timeboost_test.go Outdated Show resolved Hide resolved
arbnode/blockmetadata.go Show resolved Hide resolved
Copy link
Member

@Tristan-Wilson Tristan-Wilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

util/common.go Outdated Show resolved Hide resolved
arbnode/blockmetadata.go Show resolved Hide resolved
Copy link
Contributor

@magicxyyz magicxyyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants