Skip to content

Commit 59a967b

Browse files
Update engine/execution/computation/computer/computer.go
Co-authored-by: Alexander Hentschel <[email protected]>
1 parent fed9622 commit 59a967b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

engine/execution/computation/computer/computer.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,12 @@ func (e *blockComputer) executeSystemTransactions(
501501
var callbackTxs []*flow.TransactionBody
502502

503503
if e.vmCtx.ScheduleCallbacksEnabled {
504-
// We pass in the systemCollectionInfo here. However, the underlying flow.Collection object
505-
// must not be used, because it cannot represent the final state of the system collection.
504+
// We pass in the `systemCollectionInfo` here. However, note that at this point, the composition of the system chunk
505+
// is not yet known. Specifically, the `entity.CompleteCollection` represents the *final* output of a process and is
506+
// immutable by protocol mandate. If we had a bug in our software that accidentally illegally mutated such stucts,
507+
// likely the node encountering that bug would misbehave and get slashed, or in the worst case the flow protocol might
508+
// be compromised. Therefore, we have the rigorous convention in our code base that the `CompleteCollection` is only
509+
// constructed once the final composition of the system chunk has been determined.
506510
// To that end, the CompleteCollection is nil here, such that any attempt to access the Collection will panic.
507511
callbacks, updatedTxnIndex, err := e.executeProcessCallback(
508512
callbackCtx,

0 commit comments

Comments
 (0)