ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.56k stars 3.22k forks source link

op-supervisor: cleanup cross-L2 safety types #12098

Closed protolambda closed 3 days ago

protolambda commented 5 days ago

Description

This:

axelKingsley commented 4 days ago

While the explicit local/cross difference is nice, the safety-labels should just match the RPC labels for consistency.

Why not change the RPC labels for explicit local/cross, so that way they're consistent and fully qualified?

axelKingsley commented 3 days ago

I've approved, but some test expectations aren't matching:

mock: Unexpected Method Call
-----------------------------

Emit(engine.PromoteSafeEvent)
                0: engine.PromoteSafeEvent{Ref:eth.L2BlockRef{Hash:0xe7973076740a7c768f5583ea7207491f3ed19154eacb8fdd0a37567e0574a602, Number:0x739a77238d883876, ParentHash:0xf9a03dce23d3e099633bf1ca9ac8d0aad7586969195be733026758119801ed31, Time:0xb74eb752aba9d754, L1Origin:eth.BlockID{Hash:0x0000000000000000000000000000000000000000000000000000000000000000, Number:0x0}, SequenceNumber:0xb07331de8eabee7b}, DerivedFrom:eth.L1BlockRef{Hash:0x8ba9bdc82a6f09b8e0ec2076274673b42410c3af47d6a12187b850ffddc5eadd, Number:0x7a38aca9c395c34f, ParentHash:0x8aa813de57c92a8128804d56e80b332142b9d718d3b5e0dd26198e2da31b24f2, Time:0x86efd31d39c17ab1}}

The closest call I have is: 

Emit(engine.RequestCrossUnsafeEvent)
                0: engine.RequestCrossUnsafeEvent{}

Diff: 0: FAIL:  (engine.PromoteSafeEvent=promote-safe) != (engine.RequestCrossUnsafeEvent=request-cross-unsafe) [recovered]
        panic: 

mock: Unexpected Method Call
-----------------------------