Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get nonce from state #1710

Merged
merged 3 commits into from
Feb 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"math/big"
"time"

"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/state/runtime/executor"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -99,9 +98,13 @@ func (p *Pool) PreExecuteTx(ctx context.Context, tx types.Transaction) (state.ZK
return state.ZKCounters{}, err
}

nonce, err := p.storage.GetNonce(ctx, sender)
lastL2BlockNumber, err := p.state.GetLastL2BlockNumber(ctx, nil)
if err != nil {
return state.ZKCounters{}, err
}

nonce, err := p.state.GetNonce(ctx, sender, lastL2BlockNumber, nil)
if err != nil {
log.Errorf("Error getting nonce for sender %s: %v", sender.Hex(), err)
return state.ZKCounters{}, err
}

Expand Down