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

Add unit-test for chainsync reorg capabilities #440

Open
wants to merge 91 commits into
base: feat/optimism
Choose a base branch
from

Conversation

ezdac
Copy link
Collaborator

@ezdac ezdac commented Mar 15, 2024

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.

jannikluhn and others added 30 commits January 31, 2024 11:38
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
jannikluhn and others added 25 commits May 14, 2024 19:55
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.
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.

None yet

2 participants