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

refactor: add a interface for chain poller #125

Draft
wants to merge 3 commits into
base: base/consumer-chain-support
Choose a base branch
from

Conversation

fyInALT
Copy link

@fyInALT fyInALT commented Nov 11, 2024

In currently, the finality provider 's manger and instance use a fixed chain poller to fetch block infos from consumer chain, but for different consumer chain, the poller 's implment maybe very different.

Now the ChainPoller struct can work well for eth layer2 or op based layer2, but can not support other layer2 like orbit or zksync, so if we make a service to support orbit based consumer chain, we can not reuse the finality-provider 's code.

So we add a interface for chain poller, it can allow other service implment it 's spec poller for other chain. because the manager will create instance in runtime, so we add a chain poller factory interface as a creator.

TODO: in future we can add a mock for chain poller to test some case like consumer chain block reorg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant