mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
rename some variables
This commit is contained in:
parent
21ffa45b6f
commit
c758f7a13f
6 changed files with 268 additions and 257 deletions
|
|
@ -370,10 +370,10 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
|||
}
|
||||
if chainConfig.IsDelegationActive(vmContext.BlockNumber, vmContext.Time) {
|
||||
if len(pre.Env.Withdrawals) > 0 {
|
||||
w := pre.Env.Withdrawals[0]
|
||||
if w.Validator == gomath.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
|
||||
if err := core.ProcessStakingDistribution(evm, w.Address, amount); err != nil {
|
||||
firstWithdrawal := pre.Env.Withdrawals[0]
|
||||
if firstWithdrawal.Validator == gomath.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(firstWithdrawal.Amount), big.NewInt(params.GWei))
|
||||
if err := core.ProcessStakingDistribution(evm, firstWithdrawal.Address, amount); err != nil {
|
||||
log.Error("could not process staking distribution", "err", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,10 +331,10 @@ func (b *BlockGen) collectRequests(readonly bool) (requests [][]byte) {
|
|||
evm := vm.NewEVM(blockContext, statedb, b.cm.config, vm.Config{})
|
||||
if b.cm.config.IsDelegationActive(b.header.Number, b.header.Time) {
|
||||
if len(b.withdrawals) > 0 {
|
||||
w := b.withdrawals[0]
|
||||
if w.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
|
||||
if err := ProcessStakingDistribution(evm, w.Address, amount); err != nil {
|
||||
firstWithdrawal := b.withdrawals[0]
|
||||
if firstWithdrawal.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(firstWithdrawal.Amount), big.NewInt(params.GWei))
|
||||
if err := ProcessStakingDistribution(evm, firstWithdrawal.Address, amount); err != nil {
|
||||
log.Error("could not process staking distribution", "err", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,10 +117,10 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
|||
}
|
||||
if p.config.IsDelegationActive(block.Number(), block.Time()) {
|
||||
if len(block.Withdrawals()) > 0 {
|
||||
w := block.Withdrawals()[0]
|
||||
if w.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
|
||||
if err := ProcessStakingDistribution(evm, w.Address, amount); err != nil {
|
||||
firstWithdrawal := block.Withdrawals()[0]
|
||||
if firstWithdrawal.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(firstWithdrawal.Amount), big.NewInt(params.GWei))
|
||||
if err := ProcessStakingDistribution(evm, firstWithdrawal.Address, amount); err != nil {
|
||||
log.Error("could not process staking distribution", "err", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,10 +336,10 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
|
|||
}
|
||||
if sim.chainConfig.IsDelegationActive(header.Number, header.Time) {
|
||||
if block.BlockOverrides.Withdrawals != nil && len(*block.BlockOverrides.Withdrawals) > 0 {
|
||||
w := (*block.BlockOverrides.Withdrawals)[0]
|
||||
if w.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
|
||||
if err := core.ProcessStakingDistribution(evm, w.Address, amount); err != nil {
|
||||
firstWithdrawal := (*block.BlockOverrides.Withdrawals)[0]
|
||||
if firstWithdrawal.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(firstWithdrawal.Amount), big.NewInt(params.GWei))
|
||||
if err := core.ProcessStakingDistribution(evm, firstWithdrawal.Address, amount); err != nil {
|
||||
log.Error("could not process staking distribution", "err", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,10 +130,10 @@ func (miner *Miner) generateWork(params *generateParams, witness bool) *newPaylo
|
|||
}
|
||||
if miner.chainConfig.IsDelegationActive(work.header.Number, work.header.Time) {
|
||||
if len(params.withdrawals) > 0 {
|
||||
w := params.withdrawals[0]
|
||||
if w.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(ethparams.GWei))
|
||||
if err := core.ProcessStakingDistribution(work.evm, w.Address, amount); err != nil {
|
||||
firstWithdrawal := params.withdrawals[0]
|
||||
if firstWithdrawal.Validator == math.MaxUint64 {
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(firstWithdrawal.Amount), big.NewInt(ethparams.GWei))
|
||||
if err := core.ProcessStakingDistribution(work.evm, firstWithdrawal.Address, amount); err != nil {
|
||||
log.Error("could not process staking distribution", "err", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,9 +61,10 @@ var (
|
|||
ShanghaiTime: newUint64(1681338455),
|
||||
CancunTime: newUint64(1710338135),
|
||||
PragueTime: newUint64(1746612311),
|
||||
DelegationActivationTime: newUint64(1746612311),
|
||||
DepositContractAddress: common.HexToAddress("0x00000000219ab540356cbb839cbe05303d7705fa"),
|
||||
Ethash: new(EthashConfig),
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: newUint64(1746612311),
|
||||
BlobScheduleConfig: &BlobScheduleConfig{
|
||||
Cancun: DefaultCancunBlobConfig,
|
||||
Prague: DefaultPragueBlobConfig,
|
||||
|
|
@ -92,9 +93,10 @@ var (
|
|||
ShanghaiTime: newUint64(1696000704),
|
||||
CancunTime: newUint64(1707305664),
|
||||
PragueTime: newUint64(1740434112),
|
||||
DelegationActivationTime: newUint64(1740434112),
|
||||
DepositContractAddress: common.HexToAddress("0x4242424242424242424242424242424242424242"),
|
||||
Ethash: new(EthashConfig),
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: newUint64(1740434112),
|
||||
BlobScheduleConfig: &BlobScheduleConfig{
|
||||
Cancun: DefaultCancunBlobConfig,
|
||||
Prague: DefaultPragueBlobConfig,
|
||||
|
|
@ -123,9 +125,10 @@ var (
|
|||
ShanghaiTime: newUint64(1677557088),
|
||||
CancunTime: newUint64(1706655072),
|
||||
PragueTime: newUint64(1741159776),
|
||||
DelegationActivationTime: newUint64(1741159776),
|
||||
DepositContractAddress: common.HexToAddress("0x7f02c3e3c98b133055b8b348b2ac625669ed295d"),
|
||||
Ethash: new(EthashConfig),
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: newUint64(1741159776),
|
||||
BlobScheduleConfig: &BlobScheduleConfig{
|
||||
Cancun: DefaultCancunBlobConfig,
|
||||
Prague: DefaultPragueBlobConfig,
|
||||
|
|
@ -154,9 +157,10 @@ var (
|
|||
ShanghaiTime: newUint64(0),
|
||||
CancunTime: newUint64(0),
|
||||
PragueTime: newUint64(1742999832),
|
||||
DelegationActivationTime: newUint64(1742999832),
|
||||
DepositContractAddress: common.HexToAddress("0x00000000219ab540356cBB839Cbe05303d7705Fa"),
|
||||
Ethash: new(EthashConfig),
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: newUint64(1742999832),
|
||||
BlobScheduleConfig: &BlobScheduleConfig{
|
||||
Cancun: DefaultCancunBlobConfig,
|
||||
Prague: DefaultPragueBlobConfig,
|
||||
|
|
@ -186,11 +190,12 @@ var (
|
|||
ShanghaiTime: nil,
|
||||
CancunTime: nil,
|
||||
PragueTime: nil,
|
||||
DelegationActivationTime: nil,
|
||||
OsakaTime: nil,
|
||||
VerkleTime: nil,
|
||||
Ethash: new(EthashConfig),
|
||||
Clique: nil,
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: nil,
|
||||
}
|
||||
|
||||
AllDevChainProtocolChanges = &ChainConfig{
|
||||
|
|
@ -212,6 +217,7 @@ var (
|
|||
CancunTime: newUint64(0),
|
||||
TerminalTotalDifficulty: big.NewInt(0),
|
||||
PragueTime: newUint64(0),
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: newUint64(0),
|
||||
BlobScheduleConfig: &BlobScheduleConfig{
|
||||
Cancun: DefaultCancunBlobConfig,
|
||||
|
|
@ -242,12 +248,13 @@ var (
|
|||
ShanghaiTime: nil,
|
||||
CancunTime: nil,
|
||||
PragueTime: nil,
|
||||
DelegationActivationTime: nil,
|
||||
OsakaTime: nil,
|
||||
VerkleTime: nil,
|
||||
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
||||
Ethash: nil,
|
||||
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: nil,
|
||||
}
|
||||
|
||||
// TestChainConfig contains every protocol change (EIPs) introduced
|
||||
|
|
@ -273,12 +280,13 @@ var (
|
|||
ShanghaiTime: nil,
|
||||
CancunTime: nil,
|
||||
PragueTime: nil,
|
||||
DelegationActivationTime: nil,
|
||||
OsakaTime: nil,
|
||||
VerkleTime: nil,
|
||||
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
||||
Ethash: new(EthashConfig),
|
||||
Clique: nil,
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: nil,
|
||||
}
|
||||
|
||||
// MergedTestChainConfig contains every protocol change (EIPs) introduced
|
||||
|
|
@ -304,12 +312,13 @@ var (
|
|||
ShanghaiTime: newUint64(0),
|
||||
CancunTime: newUint64(0),
|
||||
PragueTime: newUint64(0),
|
||||
DelegationActivationTime: newUint64(0),
|
||||
OsakaTime: nil,
|
||||
VerkleTime: nil,
|
||||
TerminalTotalDifficulty: big.NewInt(0),
|
||||
Ethash: new(EthashConfig),
|
||||
Clique: nil,
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: newUint64(0),
|
||||
BlobScheduleConfig: &BlobScheduleConfig{
|
||||
Cancun: DefaultCancunBlobConfig,
|
||||
Prague: DefaultPragueBlobConfig,
|
||||
|
|
@ -339,12 +348,13 @@ var (
|
|||
ShanghaiTime: nil,
|
||||
CancunTime: nil,
|
||||
PragueTime: nil,
|
||||
DelegationActivationTime: newUint64(0),
|
||||
OsakaTime: nil,
|
||||
VerkleTime: nil,
|
||||
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
||||
Ethash: new(EthashConfig),
|
||||
Clique: nil,
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime: nil,
|
||||
}
|
||||
TestRules = TestChainConfig.Rules(new(big.Int), false, 0)
|
||||
)
|
||||
|
|
@ -426,7 +436,8 @@ type ChainConfig struct {
|
|||
TerminalTotalDifficulty *big.Int `json:"terminalTotalDifficulty,omitempty"`
|
||||
|
||||
DepositContractAddress common.Address `json:"depositContractAddress,omitempty"`
|
||||
DelegationActivationTime *uint64 `json:"delegationActivationTime,omitempty"`
|
||||
// DelegationActivationTime is the activation time of Delegation logic
|
||||
DelegationActivationTime *uint64 `json:"DelegationActivationTime,omitempty"`
|
||||
|
||||
// EnableVerkleAtGenesis is a flag that specifies whether the network uses
|
||||
// the Verkle tree starting from the genesis block. If set to true, the
|
||||
|
|
|
|||
Loading…
Reference in a new issue