package engine
import (
"time"
"github.com/ethereum-optimism/optimism/op-service/eth"
)
type BuildStartedEvent struct {
Info eth.PayloadInfo
BuildStarted time.Time
Parent eth.L2BlockRef
// if payload should be promoted to safe (must also be pending safe, see DerivedFrom)
IsLastInSpan bool
// payload is promoted to pending-safe if non-zero
DerivedFrom eth.L1BlockRef
}
func (ev BuildStartedEvent) String() string {
return "build-started"
}
func (eq *EngDeriver) onBuildStarted(ev BuildStartedEvent) {
// If a (pending) safe block, immediately seal the block
if ev.DerivedFrom != (eth.L1BlockRef{}) {
eq.emitter.Emit(BuildSealEvent{
Info: ev.Info,
BuildStarted: ev.BuildStarted,
IsLastInSpan: ev.IsLastInSpan,
DerivedFrom: ev.DerivedFrom,
})
}
}
-
protolambda authored
* op-node: sequencer / engine events refactor incl sequencer events fixes * op-node: distinguish block sealing error kinds * op-node: review fixes, stashed tweaks * op-node: events based sequencer chaos test * op-node: fix missing DerivedFrom data in attributes test * op-node: drop old wip debugging work log * op-node: sequencer move OnEvent function * op-node: update stale todo comment * op-node: detect derivation block-building as sequencer, and avoid conflict * op-node: clarify comments and rename PayloadSealTemporaryErrorEvent to PayloadSealExpiredErrorEvent to describe applicability better * op-node: prevent temporary engine error from influencing inactive sequencer
89f75545