Skip to content

Commit fa55f04

Browse files
liam-laigzliudan
authored andcommitted
Fix crash during reorg for v2.0.0 (#590) (#593)
* params: fix usage of IsXDCxDisable * internal/ethapi: fix nil block in function DoCall during reorg Co-authored-by: Daniel Liu <[email protected]>
1 parent 2d1a262 commit fa55f04

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

internal/ethapi/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.Blo
13231323
// this makes sure resources are cleaned up.
13241324
defer cancel()
13251325

1326-
block, err := b.BlockByHash(ctx, header.Hash())
1326+
block, err := b.BlockByNumberOrHash(ctx, blockNrOrHash)
13271327
if err != nil {
13281328
return nil, 0, false, err, nil
13291329
}

params/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,10 @@ func (c *ChainConfig) IsTIPXDCXReceiver(num *big.Int) bool {
626626
return isForked(common.TIPXDCX, num) && !isForked(common.TIPXDCXReceiverDisable, num)
627627
}
628628

629+
func (c *ChainConfig) IsXDCxDisable(num *big.Int) bool {
630+
return isForked(common.TIPXDCXReceiverDisable, num)
631+
}
632+
629633
func (c *ChainConfig) IsTIPXDCXLending(num *big.Int) bool {
630634
return isForked(common.TIPXDCXLending, num)
631635
}
@@ -789,7 +793,7 @@ func (c *ChainConfig) Rules(num *big.Int) Rules {
789793
IsLondon: c.IsLondon(num),
790794
IsMerge: c.IsMerge(num),
791795
IsShanghai: c.IsShanghai(num),
792-
IsXDCxDisable: c.IsTIPXDCXReceiver(num),
796+
IsXDCxDisable: c.IsXDCxDisable(num),
793797
IsEIP1559: c.IsEIP1559(num),
794798
}
795799
}

0 commit comments

Comments
 (0)