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

Feature/check tracked prefixes #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AusIV
Copy link
Contributor

@AusIV AusIV commented Jan 13, 2023

This update makes Cardinal-EVM better prepared to work with websocket streams, by only committing required data (not logs and transactions, which are provided in websocket streams) and by tracking whether state changes are included in the block.

This is a sort of soft-fork of the Cardinal-EVM streaming protocol. Because it adds a new key that old replicas will ignore, old replicas can ingest blocks produced by new masters. New replicas will reject blocks produced by old masters, as they will not have the required new key. Thus the update protocol must involve updating masters to the new producer plugin, syncing Cardinal-EVM past the last block produced by old masters, then updating Cardinal-EVM.

Austin Roberts added 2 commits January 13, 2023 10:42
Not all messages sent over cardinal streams are of interest to
Cardinal-EVM. For example logs, receipts, and transactions are needed
in Flume, but ignored by Cardinal-EVM.

With the Kafka Cardinal-Streams consumer, only tracked prefixes are
delivered, but with the Websockets consumer all prefixes are sent
across the wire and a part of the delivered PendingBatch. This means
that if we're syncing via websockets, we might be writing a lot of
additional information to disk that Cardinal-EVM will never use.

By checking keys against the set of tracked prefixes, we can ensure
that only useful information is recorded to the database.
For data sent across Kafka, if we get a message we can assume that
it will have complete block information.

For data coming from websockets, we may only have headers, receipts,
and transactions, while state updates are missing.

Prior to this update, there was no way to tell whether state updates
were missing from a block. This adds a value that will be "0" if state
updates were unavailable and "1" if they were available, and makes
the Cardinal EVM refuse to add blocks that don't indicate availability.

This does mean that, even for Kafka, producer side updates must be
done before consumer side updates, as new consumers will reject messages
produced by old producers (but old consumers will still accept messages
from new producers).
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