Skip to content

Commit

Permalink
fix pool add tx (#1721)
Browse files Browse the repository at this point in the history
* fix pool add tx

* fix
  • Loading branch information
ToniRamirezM authored Mar 2, 2023
1 parent 63ecbec commit c584e5d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"time"

"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/state/runtime/executor"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core/types"
Expand Down Expand Up @@ -80,14 +79,11 @@ func (p *Pool) AddTx(ctx context.Context, tx types.Transaction) error {

// Execute transaction to calculate its zkCounters
zkCounters, err := p.PreExecuteTx(ctx, tx)
if err == nil {
poolTx.ZKCounters = zkCounters
}

if executor.IsExecutorOutOfCountersError(executor.ExecutorErrorCode(err)) {
if err != nil {
return err
}

poolTx.ZKCounters = zkCounters
return p.storage.AddTx(ctx, poolTx)
}

Expand All @@ -97,7 +93,7 @@ func (p *Pool) PreExecuteTx(ctx context.Context, tx types.Transaction) (state.ZK
if err != nil {
return state.ZKCounters{}, err
}
return processBatchResponse.UsedZkCounters, nil
return processBatchResponse.UsedZkCounters, processBatchResponse.ExecutorError
}

// GetPendingTxs from the pool
Expand Down

0 comments on commit c584e5d

Please sign in to comment.