From c9270e481dde5579bf8bf1011477223c5ecf55e6 Mon Sep 17 00:00:00 2001 From: ImJeremyHe Date: Tue, 19 Nov 2024 08:40:16 +0800 Subject: [PATCH] Remove the espresso L2 message kind --- arbnode/batch_poster.go | 8 +++++++- arbos/parse_l2.go | 17 ----------------- execution/gethexec/executionengine.go | 14 +++++--------- system_tests/seqfeed_test.go | 1 - 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index ddab0d4c684..98aa1290dd5 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -542,7 +542,13 @@ func (b *BatchPoster) checkEspressoValidation( msg *arbostypes.MessageWithMetadata, ) error { - if !arbos.IsEspressoMsg(msg.Message) { + // We only submit the user transactions to hotshot. Only those messages created by + // sequencer should wait for the finality + if msg.Message.Header.Kind != arbostypes.L1MessageType_L2Message { + return nil + } + kind := msg.Message.L2msg[0] + if kind != arbos.L2MessageKind_Batch && kind != arbos.L2MessageKind_SignedTx { return nil } diff --git a/arbos/parse_l2.go b/arbos/parse_l2.go index 7ceeb5d0e9e..9d372ff803a 100644 --- a/arbos/parse_l2.go +++ b/arbos/parse_l2.go @@ -97,7 +97,6 @@ const ( L2MessageKind_Heartbeat = 6 // deprecated L2MessageKind_SignedCompressedTx = 7 // 8 is reserved for BLS signed batch - L2MessageKind_EspressoSovereignTx = 11 ) // Warning: this does not validate the day of the week or if DST is being observed @@ -174,12 +173,6 @@ func parseL2Message(rd io.Reader, poster common.Address, timestamp uint64, reque return nil, types.ErrTxTypeNotSupported } return types.Transactions{newTx}, nil - case L2MessageKind_EspressoSovereignTx: - result, err := parseL2Message(rd, poster, timestamp, requestId, chainId, depth) - if err != nil { - return nil, err - } - return result, nil case L2MessageKind_Heartbeat: if timestamp >= HeartbeatsDisabledAt { return nil, errors.New("heartbeat messages have been disabled") @@ -405,16 +398,6 @@ func parseBatchPostingReportMessage(rd io.Reader, chainId *big.Int, msgBatchGasC }), nil } -func IsEspressoMsg(msg *arbostypes.L1IncomingMessage) bool { - return msg.Header.Kind == arbostypes.L1MessageType_L2Message && - msg.L2msg[0] == L2MessageKind_EspressoSovereignTx -} - -func IsEspressoSovereignMsg(msg *arbostypes.L1IncomingMessage) bool { - return msg.Header.Kind == arbostypes.L1MessageType_L2Message && - msg.L2msg[0] == L2MessageKind_EspressoSovereignTx -} - func BuildHotShotPayload(msgs *[]arbostypes.L1IncomingMessage) (espressoTypes.Bytes, int) { payload := []byte{} msgCnt := 0 diff --git a/execution/gethexec/executionengine.go b/execution/gethexec/executionengine.go index a3a27014621..87a48ca6ee3 100644 --- a/execution/gethexec/executionengine.go +++ b/execution/gethexec/executionengine.go @@ -380,12 +380,8 @@ func (s *ExecutionEngine) NextDelayedMessageNumber() (uint64, error) { return currentHeader.Nonce.Uint64(), nil } -func MessageFromTxes(header *arbostypes.L1IncomingMessageHeader, txes types.Transactions, txErrors []error, espressoSovereignSequencer bool) (*arbostypes.L1IncomingMessage, error) { +func MessageFromTxes(header *arbostypes.L1IncomingMessageHeader, txes types.Transactions, txErrors []error) (*arbostypes.L1IncomingMessage, error) { var l2Message []byte - if espressoSovereignSequencer { - // Add a specific l2 message kind in front of the bytes. - l2Message = append(l2Message, arbos.L2MessageKind_EspressoSovereignTx) - } if len(txes) == 1 && txErrors[0] == nil { txBytes, err := txes[0].MarshalBinary() @@ -466,7 +462,7 @@ func (s *ExecutionEngine) resequenceReorgedMessages(messages []*arbostypes.Messa } hooks := arbos.NoopSequencingHooks() hooks.DiscardInvalidTxsEarly = true - _, err = s.sequenceTransactionsWithBlockMutex(msg.Message.Header, txes, hooks, arbos.IsEspressoSovereignMsg(msg.Message)) + _, err = s.sequenceTransactionsWithBlockMutex(msg.Message.Header, txes, hooks) if err != nil { log.Error("failed to re-sequence old user message removed by reorg", "err", err) return @@ -507,7 +503,7 @@ func (s *ExecutionEngine) sequencerWrapper(sequencerFunc func() (*types.Block, e func (s *ExecutionEngine) SequenceTransactions(header *arbostypes.L1IncomingMessageHeader, txes types.Transactions, hooks *arbos.SequencingHooks, espressoSovereign bool) (*types.Block, error) { return s.sequencerWrapper(func() (*types.Block, error) { hooks.TxErrors = nil - return s.sequenceTransactionsWithBlockMutex(header, txes, hooks, espressoSovereign) + return s.sequenceTransactionsWithBlockMutex(header, txes, hooks) }) } @@ -549,7 +545,7 @@ func writeAndLog(pprof, trace *bytes.Buffer) { log.Info("Transactions sequencing took longer than 2 seconds, created pprof and trace files", "pprof", pprofFile, "traceFile", traceFile) } -func (s *ExecutionEngine) sequenceTransactionsWithBlockMutex(header *arbostypes.L1IncomingMessageHeader, txes types.Transactions, hooks *arbos.SequencingHooks, espressoSovereign bool) (*types.Block, error) { +func (s *ExecutionEngine) sequenceTransactionsWithBlockMutex(header *arbostypes.L1IncomingMessageHeader, txes types.Transactions, hooks *arbos.SequencingHooks) (*types.Block, error) { lastBlockHeader, err := s.getCurrentHeader() if err != nil { return nil, err @@ -597,7 +593,7 @@ func (s *ExecutionEngine) sequenceTransactionsWithBlockMutex(header *arbostypes. return nil, nil } - msg, err := MessageFromTxes(header, txes, hooks.TxErrors, espressoSovereign) + msg, err := MessageFromTxes(header, txes, hooks.TxErrors) if err != nil { return nil, err } diff --git a/system_tests/seqfeed_test.go b/system_tests/seqfeed_test.go index 0b794a04b11..21f07552250 100644 --- a/system_tests/seqfeed_test.go +++ b/system_tests/seqfeed_test.go @@ -384,7 +384,6 @@ func testBlockHashComparison(t *testing.T, blockHash *common.Hash, mustMismatch &l1IncomingMsgHeader, types.Transactions{tx}, []error{nil}, - false, ) Require(t, err)