Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion consensus/XDPoS/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ func (api *API) getRewardFileNamesInRange(begin, end *rpc.BlockNumber) ([]reward

// compact the slice's memory
ret := rewardFileNames[startIndex:endIndex]
return ret[:len(ret):len(ret)], nil
return slices.Clip(ret), nil
}

func getEpochReward(account common.Address, header *types.Header) (AccountEpochReward, error) {
Expand Down
19 changes: 10 additions & 9 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package vm
import (
"errors"
"math/big"
"slices"
"sync/atomic"

"github.com/XinFinOrg/XDPoSChain/XDCx/tradingstate"
Expand Down Expand Up @@ -170,20 +171,20 @@ func NewEVM(blockCtx BlockContext, txCtx TxContext, statedb StateDB, tradingStat
default:
evm.table = &frontierInstructionSet
}
var extraEips []int
if len(evm.Config.ExtraEips) > 0 {
// Deep-copy jumptable to prevent modification of opcodes in other tables
evm.table = copyJumpTable(evm.table)
}
extraEips := make([]int, 0, len(evm.Config.ExtraEips))
for _, eip := range evm.Config.ExtraEips {
if err := EnableEIP(eip, evm.table); err != nil {
// Disable it, so caller can check if it's activated or not
log.Error("EIP activation failed", "eip", eip, "error", err)
} else {
extraEips = append(extraEips, eip)
for _, eip := range evm.Config.ExtraEips {
if err := EnableEIP(eip, evm.table); err != nil {
// Disable it, so caller can check if it's activated or not
log.Error("EIP activation failed", "eip", eip, "error", err)
} else {
extraEips = append(extraEips, eip)
}
}
}
evm.Config.ExtraEips = extraEips[0:len(extraEips):len(extraEips)]
evm.Config.ExtraEips = slices.Clip(extraEips)

return evm
}
Expand Down