mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
* Add the new Fulu state with the new field * fix the hasher for the fulu state * Fix ToProto() and ToProtoUnsafe() * Add the fields as shared * Add epoch transition code * short circuit the proposer cache to use the state * Marshal the state JSON * update spectests to 1.6.0-alpha.1 * Remove deneb and electra entries from blob schedule This was cherry picked from PR #15364 and edited to remove the minimal cases * Fix minimal tests * Increase deadling for processing blocks in spectests * Preston's review * review --------- Co-authored-by: terence tsao <terence@prysmaticlabs.com>
34 lines
1.0 KiB
Go
34 lines
1.0 KiB
Go
package operations
|
|
|
|
import (
|
|
"github.com/OffchainLabs/prysm/v6/beacon-chain/state"
|
|
state_native "github.com/OffchainLabs/prysm/v6/beacon-chain/state/state-native"
|
|
"github.com/OffchainLabs/prysm/v6/consensus-types/blocks"
|
|
"github.com/OffchainLabs/prysm/v6/consensus-types/interfaces"
|
|
ethpb "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
func sszToState(b []byte) (state.BeaconState, error) {
|
|
base := ðpb.BeaconStateFulu{}
|
|
if err := base.UnmarshalSSZ(b); err != nil {
|
|
return nil, err
|
|
}
|
|
return state_native.InitializeFromProtoFulu(base)
|
|
}
|
|
|
|
func sszToBlock(b []byte) (interfaces.SignedBeaconBlock, error) {
|
|
base := ðpb.BeaconBlockElectra{}
|
|
if err := base.UnmarshalSSZ(b); err != nil {
|
|
return nil, err
|
|
}
|
|
return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: base})
|
|
}
|
|
|
|
func sszToBlockBody(b []byte) (interfaces.ReadOnlyBeaconBlockBody, error) {
|
|
base := ðpb.BeaconBlockBodyElectra{}
|
|
if err := base.UnmarshalSSZ(b); err != nil {
|
|
return nil, err
|
|
}
|
|
return blocks.NewBeaconBlockBody(base)
|
|
}
|