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

feat(worker): Check chain id #228

Merged
merged 3 commits into from
May 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions miner/taiko_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ func (w *worker) sealBlockWith(
env.gasPool = new(core.GasPool).AddGas(gasLimit)

for i, tx := range txs {
if tx.ChainId().Cmp(w.chainConfig.ChainID) != 0 {
if i == 0 {
return nil, fmt.Errorf("anchor tx invalid chain id, expected: %v, actual: %v", w.chainConfig.ChainID, tx.ChainId())
davidtaikocha marked this conversation as resolved.
Show resolved Hide resolved
} else {
log.Debug("Skip an invalid chain id", "hash", tx.Hash(), "expect", w.chainConfig.ChainID, "actual", tx.ChainId())
davidtaikocha marked this conversation as resolved.
Show resolved Hide resolved
continue
}
}

if i == 0 {
if err := tx.MarkAsAnchor(); err != nil {
return nil, err
Expand Down
Loading