Skip to content

Commit

Permalink
Access list nil reference issue related to method handler crashed. (d…
Browse files Browse the repository at this point in the history
…ominant-strategies#224)

* Enabling contract deployment

* Removed nil access list, set up ways to check rules to add accessList

* GasLimitBoundDivisor to 256

Co-authored-by: Alan Orwick <[email protected]>
  • Loading branch information
shreekarashastry and alanorwick authored Apr 4, 2022
1 parent 2b5ba43 commit f957207
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion consensus/misc/gaslimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error {
diff *= -1
}
limit := parentGasLimit / params.GasLimitBoundDivisor
if uint64(diff) >= limit && headerGasLimit > params.EmptyGasLimit {
if uint64(diff) >= limit {
return fmt.Errorf("invalid gas limit: have %d, want %d +-= %d", headerGasLimit, parentGasLimit, limit-1)
}
if headerGasLimit < params.MinGasLimit {
Expand Down
1 change: 1 addition & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,7 @@ func (bc *BlockChain) ReOrgRollBack(header *types.Header) error {
}
deletedTxs = append(deletedTxs, currentBlock.Transactions()...)
collectLogs(currentBlock.Hash())

currentBlock = bc.GetBlock(currentBlock.ParentHash(), currentBlock.NumberU64()-1)
if currentBlock == nil {
return fmt.Errorf("invalid current chain")
Expand Down
4 changes: 2 additions & 2 deletions params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import "math/big"

const (
GasLimitBoundDivisor uint64 = 256 // The bound divisor of the gas limit, used in update calculations.
MinGasLimit uint64 = 5000 // Minimum the gas limit may ever be.
EmptyGasLimit uint64 = 2000000 // Gas limit at empty blocks
MinGasLimit uint64 = 100000 // Minimum the gas limit may ever be.
EmptyGasLimit uint64 = 4712388 // Gas limit at empty blocks
GenesisGasLimit uint64 = 4712388 // Gas limit of the Genesis block.

MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis.
Expand Down

0 comments on commit f957207

Please sign in to comment.