mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-18 08:38:46 +00:00
Allow for increased Shanghai time with PulseChain
This commit is contained in:
parent
3951368f53
commit
f4215353af
@ -238,6 +238,9 @@ func (s *Merge) verifyHeader(chain consensus.ChainHeaderReader, header, parent *
|
|||||||
|
|
||||||
// Verify existence / non-existence of withdrawalsHash
|
// Verify existence / non-existence of withdrawalsHash
|
||||||
shanghai := chain.Config().IsShanghai(header.Time)
|
shanghai := chain.Config().IsShanghai(header.Time)
|
||||||
|
if chain.Config().PrimordialPulseAhead(header.Number.Uint64()) {
|
||||||
|
shanghai = params.MainnetChainConfig.IsShanghai(header.Time)
|
||||||
|
}
|
||||||
if shanghai && header.WithdrawalsHash == nil {
|
if shanghai && header.WithdrawalsHash == nil {
|
||||||
return fmt.Errorf("missing withdrawalsHash")
|
return fmt.Errorf("missing withdrawalsHash")
|
||||||
}
|
}
|
||||||
|
@ -289,11 +289,15 @@ func (s *EthBackendServer) stageLoopIsBusy() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *EthBackendServer) checkWithdrawalsPresence(time uint64, withdrawals []*types.Withdrawal) error {
|
func (s *EthBackendServer) checkWithdrawalsPresence(num uint64, time uint64, withdrawals []*types.Withdrawal) error {
|
||||||
if !s.config.IsShanghai(time) && withdrawals != nil {
|
shanghai := s.config.IsShanghai(time)
|
||||||
|
if s.config.PrimordialPulseAhead(num) {
|
||||||
|
shanghai = params.MainnetChainConfig.IsShanghai(time)
|
||||||
|
}
|
||||||
|
if !shanghai && withdrawals != nil {
|
||||||
return &rpc.InvalidParamsError{Message: "withdrawals before shanghai"}
|
return &rpc.InvalidParamsError{Message: "withdrawals before shanghai"}
|
||||||
}
|
}
|
||||||
if s.config.IsShanghai(time) && withdrawals == nil {
|
if shanghai && withdrawals == nil {
|
||||||
return &rpc.InvalidParamsError{Message: "missing withdrawals list"}
|
return &rpc.InvalidParamsError{Message: "missing withdrawals list"}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -329,7 +333,7 @@ func (s *EthBackendServer) EngineNewPayload(ctx context.Context, req *types2.Exe
|
|||||||
header.WithdrawalsHash = &wh
|
header.WithdrawalsHash = &wh
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := s.checkWithdrawalsPresence(header.Time, withdrawals); err != nil {
|
if err := s.checkWithdrawalsPresence(header.Number.Uint64(), header.Time, withdrawals); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,7 +725,7 @@ func (s *EthBackendServer) EngineForkChoiceUpdated(ctx context.Context, req *rem
|
|||||||
if payloadAttributes.Version >= 2 {
|
if payloadAttributes.Version >= 2 {
|
||||||
param.Withdrawals = ConvertWithdrawalsFromRpc(payloadAttributes.Withdrawals)
|
param.Withdrawals = ConvertWithdrawalsFromRpc(payloadAttributes.Withdrawals)
|
||||||
}
|
}
|
||||||
if err := s.checkWithdrawalsPresence(payloadAttributes.Timestamp, param.Withdrawals); err != nil {
|
if err := s.checkWithdrawalsPresence(*headNumber, payloadAttributes.Timestamp, param.Withdrawals); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user