Collecting two extra timestamps in the block lifecycle #301
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.
📝 Summary
The exact timing of events is critical in MEV boost. We that relays should collect two additional timestamps
getPayload
is verified, meaning the proposer is committed to that header.⛱ Motivation and Context
Currently, the only timestamps collected by the relay are
a) when a bid is received from the builder,
b) when the bid is inserted into the DB,
c) when the delivered payload is inserted into the DB.
Since the DB writes happen off the critical path (they are deferred and happen in a separate goroutine), the accuracy of this data is relatively low. For example, you could find that the timestamp for when a delivered payload is inserted into the DB is before the timestamp for when the bid is inserted into the DB (if the bid comes right at the end of the slot and wins the auction). By collecting this additional data, we can have strong assurances about the relationship between when events occurred. For example, we can assert that the eligibility timestamp (1 above) must come before the signed timestamp (2 above), because a bid must be eligible before it can be retrieved by a call to
getHeader
. This also allows us to accurately determine the time between when a bit became active and when the proposer signed the header associated with that bid.In the figure below, we are proposing collecting timestamps for
bid is active
andget payload
(after signature verification).📚 References
This is related to our optimistic relaying work, where we are paying close attention to the latency games associated with mev-boost. See the proposal and the roadmap. Additionally, this related to the study of latency/timing games: ROP-0
✅ I have run these commands
make lint
make test-race
go mod tidy
CONTRIBUTING.md