Skip to content

Commit

Permalink
remove execution mode (#3395)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM authored Feb 28, 2024
1 parent f7f1809 commit e0cd81e
Show file tree
Hide file tree
Showing 14 changed files with 784 additions and 824 deletions.
1 change: 0 additions & 1 deletion proto/src/proto/executor/v1/executor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ message ProcessBatchRequestV2 {
// prior to executing the call.
map<string, OverrideAccountV2> state_override = 23;
DebugV2 debug = 24;
uint64 execution_mode = 25;
}

message L1DataV2 {
Expand Down
2 changes: 0 additions & 2 deletions sequencer/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
stateMetrics "github.com/0xPolygonHermez/zkevm-node/state/metrics"
"github.com/0xPolygonHermez/zkevm-node/state/runtime/executor"
"github.com/ethereum/go-ethereum/common"
)

Expand Down Expand Up @@ -377,7 +376,6 @@ func (f *finalizer) batchSanityCheck(ctx context.Context, batchNum uint64, initi
ForkID: f.stateIntf.GetForkIDByBatchNumber(batch.BatchNumber),
SkipVerifyL1InfoRoot_V2: true,
Caller: stateMetrics.DiscardCallerLabel,
ExecutionMode: executor.ExecutionMode0,
}
batchRequest.L1InfoTreeData_V2, _, _, err = f.stateIntf.GetL1InfoTreeDataFromBatchL2Data(ctx, batch.BatchL2Data, nil)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion sequencer/finalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ func (f *finalizer) processTransaction(ctx context.Context, tx *TxTracker, first
SkipWriteBlockInfoRoot_V2: true,
SkipVerifyL1InfoRoot_V2: true,
L1InfoTreeData_V2: map[uint32]state.L1DataV2{},
ExecutionMode: executor.ExecutionMode0,
}

txGasPrice := tx.GasPrice
Expand Down
2 changes: 0 additions & 2 deletions sequencer/forcedbatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
stateMetrics "github.com/0xPolygonHermez/zkevm-node/state/metrics"
"github.com/0xPolygonHermez/zkevm-node/state/runtime/executor"
"github.com/ethereum/go-ethereum/common"
"github.com/jackc/pgx/v4"
)
Expand Down Expand Up @@ -106,7 +105,6 @@ func (f *finalizer) processForcedBatch(ctx context.Context, forcedBatch state.Fo
ForkID: f.stateIntf.GetForkIDByBatchNumber(lastBatchNumber),
SkipVerifyL1InfoRoot_V2: true,
Caller: stateMetrics.DiscardCallerLabel,
ExecutionMode: executor.ExecutionMode0,
}

batchResponse, err := f.stateIntf.ProcessBatchV2(ctx, batchRequest, true)
Expand Down
3 changes: 0 additions & 3 deletions sequencer/l2block.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/0xPolygonHermez/zkevm-node/pool"
"github.com/0xPolygonHermez/zkevm-node/state"
stateMetrics "github.com/0xPolygonHermez/zkevm-node/state/metrics"
"github.com/0xPolygonHermez/zkevm-node/state/runtime/executor"
"github.com/ethereum/go-ethereum/common"
)

Expand Down Expand Up @@ -284,7 +283,6 @@ func (f *finalizer) executeL2Block(ctx context.Context, initialStateRoot common.
ForkID: f.stateIntf.GetForkIDByBatchNumber(f.wipBatch.batchNumber),
SkipVerifyL1InfoRoot_V2: true,
L1InfoTreeData_V2: map[uint32]state.L1DataV2{},
ExecutionMode: executor.ExecutionMode0,
}
batchRequest.L1InfoTreeData_V2[l2Block.l1InfoTreeExitRoot.L1InfoTreeIndex] = state.L1DataV2{
GlobalExitRoot: l2Block.l1InfoTreeExitRoot.GlobalExitRoot.GlobalExitRoot,
Expand Down Expand Up @@ -584,7 +582,6 @@ func (f *finalizer) executeNewWIPL2Block(ctx context.Context) (*state.ProcessBat
SkipFirstChangeL2Block_V2: false,
Transactions: f.stateIntf.BuildChangeL2Block(f.wipL2Block.deltaTimestamp, f.wipL2Block.getL1InfoTreeIndex()),
L1InfoTreeData_V2: map[uint32]state.L1DataV2{},
ExecutionMode: executor.ExecutionMode0,
}

batchRequest.L1InfoTreeData_V2[f.wipL2Block.l1InfoTreeExitRoot.L1InfoTreeIndex] = state.L1DataV2{
Expand Down
3 changes: 0 additions & 3 deletions state/batchV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func (s *State) ProcessBatchV2(ctx context.Context, request ProcessRequest, upda
ChainId: s.cfg.ChainID,
ForkId: request.ForkID,
ContextId: uuid.NewString(),
ExecutionMode: request.ExecutionMode,
}

if request.SkipFirstChangeL2Block_V2 {
Expand Down Expand Up @@ -132,7 +131,6 @@ func (s *State) ExecuteBatchV2(ctx context.Context, batch Batch, L1InfoTreeRoot
ForkId: forkId,
ContextId: uuid.NewString(),
SkipVerifyL1InfoRoot: skipVerifyL1InfoRoot,
ExecutionMode: executor.ExecutionMode1,
}

if forcedBlockHashL1 != nil {
Expand Down Expand Up @@ -233,7 +231,6 @@ func (s *State) processBatchV2(ctx context.Context, processingCtx *ProcessingCon
ContextId: uuid.NewString(),
SkipVerifyL1InfoRoot: processingCtx.SkipVerifyL1InfoRoot,
L1InfoRoot: processingCtx.L1InfoRoot.Bytes(),
ExecutionMode: processingCtx.ExecutionMode,
}

if processingCtx.ForcedBlockHashL1 != nil {
Expand Down
7 changes: 0 additions & 7 deletions state/runtime/executor/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ import (
"google.golang.org/grpc/credentials/insecure"
)

const (
// ExecutionMode0 is the execution mode for the sequencer and RPC, default one
ExecutionMode0 = uint64(0)
// ExecutionMode1 is the execution mode for the synchronizer
ExecutionMode1 = uint64(1)
)

// NewExecutorClient is the executor client constructor.
func NewExecutorClient(ctx context.Context, c Config) (ExecutorServiceClient, *grpc.ClientConn, context.CancelFunc) {
opts := []grpc.DialOption{
Expand Down
Loading

0 comments on commit e0cd81e

Please sign in to comment.