Skip to content

Commit

Permalink
VerifyHeader verifies that the coinbase is in scope
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Sep 15, 2023
1 parent 0a7d1fc commit 137dd0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/blake3pow/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ func (blake3pow *Blake3pow) verifyHeader(chain consensus.ChainHeaderReader, head
}

if nodeCtx == common.ZONE_CTX {
// check if the header coinbase is in scope
_, err := header.Coinbase().InternalAddress()
if err != nil {
return fmt.Errorf("out-of-scope coinbase in the header")
}
// Verify that the gas limit is <= 2^63-1
cap := uint64(0x7fffffffffffffff)
if header.GasLimit() > cap {
Expand Down
5 changes: 5 additions & 0 deletions consensus/progpow/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ func (progpow *Progpow) verifyHeader(chain consensus.ChainHeaderReader, header,
}
}
if nodeCtx == common.ZONE_CTX {
// check if the header coinbase is in scope
_, err := header.Coinbase().InternalAddress()
if err != nil {
return fmt.Errorf("out-of-scope coinbase in the header")
}
// Verify that the gas limit is <= 2^63-1
cap := uint64(0x7fffffffffffffff)
if header.GasLimit() > cap {
Expand Down

0 comments on commit 137dd0a

Please sign in to comment.