-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add unit-test for chainsync reorg capabilities #440
Open
ezdac
wants to merge
91
commits into
feat/optimism
Choose a base branch
from
ezdac/feat/optimism
base: feat/optimism
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The 'newKeyperSet' method defined on the optimism keyper struct was using the dbpool field without it being assigned during the startup phase. This resulted in a nil-pointer dereference whenever a new keyperset was observed onchain.
The recent separation of a blocking Run() and a non-blocking RunBackground() introduced a bug that prematurely executed registered defer functions on the runner. This is a critical error that is now fixed by having RunBackground return the defer function as well.
The service function is renamed and in addition to the context also receives the Runner instance
e9c5136
to
fdf3dd8
Compare
Now we use SSZ as required by the spec. Before we did an easier encoding as a placeholder.
Here, the eon refers to the keyper config index, not the keyper-internal eon. Note that the tx pointer is also read by other parties including validators, so using the proper eon (from Shuttermint) which is only meaningful in a keyper DKG context does not make sense. We should rename the message field in the spec at some point.
The block parameter was broken and not supplied.
Log the proposer index when skipping due to an unregistered proposer. Also, fix another message.
Identity preimages must be 52 bytes long (32 prefix + 20 address). The slot identity preimage did not follow this.
Instead of syncing the whole block range in a single request to the execution node, split it up into multiple. This is important at initial sync and after a long period of being offline. Also, perform an initial sync at startup, so that this potentially long operation does not happen during normal slot processing.
Deserializing the pubkey does not work out of the box. For simplicity, we parse it as a string and then add a getter that performs deserialization.
In epoch key generation related p2p messages, we only use the keyper config index, not the eon index.
Previously, we used the eon from the p2p message as the key to query the dkg result from the db. However, the msg eon is the keyper config index. We therefore have to translate into the internal eon value.
This removes some unnecessary complexity. In particular, it means we can perform an initial sequencer sync at startup, instead of only when we receive a keyper set.
Before, the chainsync did not fetch all subscribed events from the provided 'WithSyncStartBlock' to the current latest head. This is now fixed with a mechanism where the chainsync is progressing a sync-head in tandem with the incoming updates for the latest head. The syncer will catch up with polling for all older blocks until the current latest head is reached.
fdf3dd8
to
80f095d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The chainsync handles re-orgs now - this PR adds a dummy ethereum client and a test of the re-org capabilities of the chainsync unsafe head handler.