mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 20:20:05 +00:00
cafe0bd1f8
* fork * types * cloners * getters * remove CapellaBlind from fork * hasher * setters * spec params, config tests * generate ssz * executionPayloadHeaderCapella * proto state * BeaconStateCapella SSZ * saving state * configfork * BUILD files * fix RealPosition * fix hasher * SetLatestExecutionPayloadHeaderCapella * fix error message * reduce complexity of saveStatesEfficientInternal * add latestExecutionPayloadHeaderCapella to minimal state * halway done interface * remove withdrawal methods * merge setters * change signatures for v1 and v2 * fixing errors pt. 1 * paylod_test fixes * fix everything * remove unused func * fix tests * state_trie_test improvements * in progress... * hasher test * fix configs * simplify hashing * Revert "fix configs" This reverts commit bcae2825fcc8ba45a2b43d68ad0ab57f8eac8952. * remove capella from config test * unify locking * review * hashing * fixes Co-authored-by: terencechain <terence@prysmaticlabs.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package state_native
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
nativetypes "github.com/prysmaticlabs/prysm/v3/beacon-chain/state/state-native/types"
|
|
"github.com/prysmaticlabs/prysm/v3/consensus-types/interfaces"
|
|
enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1"
|
|
_ "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/v3/runtime/version"
|
|
)
|
|
|
|
// SetLatestExecutionPayloadHeader for the beacon state.
|
|
func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionData) error {
|
|
b.lock.Lock()
|
|
defer b.lock.Unlock()
|
|
|
|
if b.version < version.Bellatrix {
|
|
return errNotSupported("SetLatestExecutionPayloadHeader", b.version)
|
|
}
|
|
|
|
switch header := val.Proto().(type) {
|
|
case *enginev1.ExecutionPayloadHeader:
|
|
b.latestExecutionPayloadHeader = header
|
|
b.markFieldAsDirty(nativetypes.LatestExecutionPayloadHeader)
|
|
return nil
|
|
case *enginev1.ExecutionPayloadHeaderCapella:
|
|
b.latestExecutionPayloadHeaderCapella = header
|
|
b.markFieldAsDirty(nativetypes.LatestExecutionPayloadHeaderCapella)
|
|
return nil
|
|
default:
|
|
return errors.New("value must be an execution payload header")
|
|
}
|
|
}
|