Open jordanschalm opened 1 week ago
Attention: Patch coverage is 70.14925%
with 20 lines
in your changes missing coverage. Please review.
Project coverage is 41.73%. Comparing base (
d0c9695
) to head (718a5ee
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
Chunk.ServiceEventIndices
field). For example, it would be nice if consensus nodes could drop Execution Results with the deprecated format and avoid incorporating them into a block (and rejecting blocks that still do). receiptValidator
(somewhere around here). I was wondering if your plan is still to remove Chunk.ServiceEventIndices
field for Byzantine Fault Tolerance in the long term? I think we had talked about turning ExecutionResult.ServiceEventList
into an indexed list. Or are you thinking about keeping the ServiceEventIndices
field as the long-term solution -- just with removing the backwards-compatibility case?
In general, my preference would be to also allow Chunk.ServiceEventIndices = nil
when there are no service events generated in the chunk. Thereby the final solution becomes a lot more intuitive:
if ExecutionResult.ServiceEvents
is not empty (nil allowed), then the new convention requires for consistency:
$$\sum_\texttt{Chunk} \texttt{len}(Chunk.ServiceEventIndices) = \texttt{len}(\texttt{ExecutionResult.ServiceEventList})\qquad\qquad\qquad\qquad(1) $$
I feel is check is very similar to other stuff, which consensus nodes already verify about an Execution Receipt
(see ReceiptValidator
implementation)
ServiceEventIndices
fields of all chunks can be nil despite there being service events. ExecutionResult.ServiceEventList
is empty in the majority cases. Then both the deprecated as well as the new conventions would allow ChunkBody.ServiceEventIndices
to be nil
(which is the most intuitive convention anyway). Also, for individual chunks that don't produce any service events, their ChunkBody.ServiceEventIndices
could be nil
or empty according to the new convention. Then, also the new convention is very self-consistent in my opinion - and the depreciation condition is only an add on that can be later removed. I mean is this is only a temporary solution, I am happy and we can skip most of question 3.
ServiceEventIndices
structureServiceEventsNumber
, a uint16 which is a count of the number of service events emitted in that chunk
sum(chunk.ServiceEventsNumber for chunk in chunks) == len(ServiceEvents)
ServiceEventsNumber
fields are 0, then this is interpreted as a v0 model version: all service events must have been emitted in the system chunk.We plan to keep the overall structure as the long term solution, and only remove the backward-compatibility support at the next spork. We do not plan to use a different representation (ie. Chunk.ServiceEventIndices field).
ProtocolVersionUpgade
service event. This service event is emitted outside the system chunk, meaning that the first Protocol HCU must take place after the service event validation fix has been deployed.feature/efm-recovery
in one Protocol HCU.feature/efm-recovery
.
This PR adds support for specifying which service events were emitted in which chunk, by modifying the
ChunkBody
data structure in a backward compatible manner. Addresses #6622.Changes
ServiceEventIndices
field toChunkBody
:ChunkBody
will unmarshal into a struct with a nilServiceEventIndices
. We define a chunk with nilServiceEventIndices
to have the same semantics as before the field existed: if any service events were emitted, then they were emitted from the system chunk.ChunkBody
will always have non-nilServiceEventIndices
Upgrade Notes
Currently, no service events are emitted outside of the system chunk. Let's call the first block at which this happens block X.
This PR replaces two prior approaches, implemented in part https://github.com/onflow/flow-go/pull/6629 and https://github.com/onflow/flow-go/pull/6730.