mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 05:47:59 -05:00
Compare commits
185 Commits
don_update
...
e2e-at-cap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
317c09c40a | ||
|
|
2c2f56cc7e | ||
|
|
58acdb5136 | ||
|
|
fa8a6d9d17 | ||
|
|
743037efb5 | ||
|
|
301970cf5a | ||
|
|
01ae2fe7be | ||
|
|
1cfe5988e6 | ||
|
|
a40cadab32 | ||
|
|
9f5f807303 | ||
|
|
5f6147ecf7 | ||
|
|
b97d2827e9 | ||
|
|
8f06f72eed | ||
|
|
046882401e | ||
|
|
ce339bc22b | ||
|
|
1ec5d45d8d | ||
|
|
daa4fd2b72 | ||
|
|
5bdffb82e3 | ||
|
|
aabcaac619 | ||
|
|
d86a452b15 | ||
|
|
9f3bb623ec | ||
|
|
b10a95097e | ||
|
|
ffbb73a59b | ||
|
|
649974f14d | ||
|
|
9ec0bc0734 | ||
|
|
b6a32c050f | ||
|
|
055e225093 | ||
|
|
144218cb1b | ||
|
|
13b575a609 | ||
|
|
b5a414eae9 | ||
|
|
b94b347ace | ||
|
|
f5ee225819 | ||
|
|
9cb48be14f | ||
|
|
ffcdc26618 | ||
|
|
96981a07b9 | ||
|
|
6b2721b239 | ||
|
|
911048aa6d | ||
|
|
255e9693ee | ||
|
|
d602c94b7b | ||
|
|
6a5ecbd68f | ||
|
|
29dfcab505 | ||
|
|
16e5c903cc | ||
|
|
66682cb4e5 | ||
|
|
cab42a4ae3 | ||
|
|
a5bdd42bdd | ||
|
|
a26197f919 | ||
|
|
080ce31395 | ||
|
|
d5d17e00b3 | ||
|
|
9c6a1331cf | ||
|
|
8629ac8417 | ||
|
|
6dcb2bbf0d | ||
|
|
deb138959a | ||
|
|
45e6f3bd00 | ||
|
|
55a9e0d51a | ||
|
|
3ddae600fb | ||
|
|
56503110dd | ||
|
|
f67d35dffd | ||
|
|
b05b67b264 | ||
|
|
a5c6518c20 | ||
|
|
da048395ce | ||
|
|
f31f7be310 | ||
|
|
e1a2267f86 | ||
|
|
3c9e4ee7f7 | ||
|
|
9ba32c9acd | ||
|
|
d23008452e | ||
|
|
f397cba1e0 | ||
|
|
1583e93b48 | ||
|
|
849457df81 | ||
|
|
903cab75ee | ||
|
|
ee108d4aff | ||
|
|
49bcc58762 | ||
|
|
a08baf4a14 | ||
|
|
8c56dfdd46 | ||
|
|
dcdd9af9db | ||
|
|
a464cf5c60 | ||
|
|
2d483ab09f | ||
|
|
6e26a6f128 | ||
|
|
b512b92a8a | ||
|
|
b0601580ef | ||
|
|
c1f29ea651 | ||
|
|
881d1d435a | ||
|
|
d1aae0c941 | ||
|
|
57bdb907cc | ||
|
|
15d683c78f | ||
|
|
bf6c8ced7d | ||
|
|
78fb685027 | ||
|
|
98c0b23350 | ||
|
|
039a0fffba | ||
|
|
90ec640e7a | ||
|
|
10acd31d25 | ||
|
|
df1e8b33d8 | ||
|
|
cdb4ee42cc | ||
|
|
d29baec77e | ||
|
|
0adc54b7ff | ||
|
|
1cbd7e9888 | ||
|
|
0a9e1658dd | ||
|
|
31d4a4cd11 | ||
|
|
fbc4e73d31 | ||
|
|
c1d4eaa79d | ||
|
|
760af6428e | ||
|
|
dfa0ccf626 | ||
|
|
1a51fdbd58 | ||
|
|
368a99ec8d | ||
|
|
1c7e734918 | ||
|
|
764d1325bf | ||
|
|
0cf30e9022 | ||
|
|
227b20f368 | ||
|
|
d7d70bc25b | ||
|
|
82f6ddb693 | ||
|
|
9e4e82d2c5 | ||
|
|
9838369fe9 | ||
|
|
6085ad1bfa | ||
|
|
d3851b27df | ||
|
|
d6100dfdcb | ||
|
|
c2144dac86 | ||
|
|
a47ff569a8 | ||
|
|
f8be022ef2 | ||
|
|
4f39e6b685 | ||
|
|
c67b000633 | ||
|
|
02f7443586 | ||
|
|
6275e7df4e | ||
|
|
1b6b52fda1 | ||
|
|
5fa1fd84b9 | ||
|
|
bd0c9f9e8d | ||
|
|
2532bb370c | ||
|
|
12efc6c2c1 | ||
|
|
a6cc9ac9c5 | ||
|
|
031f5845a2 | ||
|
|
b88559726c | ||
|
|
62f6b07cba | ||
|
|
f956f1ed6e | ||
|
|
16b0820193 | ||
|
|
4b02267e96 | ||
|
|
746584c453 | ||
|
|
b56daaaca2 | ||
|
|
931e5e10c3 | ||
|
|
c172f838b1 | ||
|
|
c07ae29cd9 | ||
|
|
214c9bfd8b | ||
|
|
716140d64d | ||
|
|
088cb4ef59 | ||
|
|
d1472fc351 | ||
|
|
5c8c0c31d8 | ||
|
|
7f3c00c7a2 | ||
|
|
c180dab791 | ||
|
|
f24acc21c7 | ||
|
|
40b637849d | ||
|
|
e7db1685df | ||
|
|
eccbfd1011 | ||
|
|
90211f6769 | ||
|
|
edc32ac18e | ||
|
|
fe68e020e3 | ||
|
|
81e1e3544d | ||
|
|
09372d5c35 | ||
|
|
078a89e4ca | ||
|
|
dbc6ae26a6 | ||
|
|
b6f429867a | ||
|
|
09f50660ce | ||
|
|
189825b495 | ||
|
|
764b7ff610 | ||
|
|
d499db7f0e | ||
|
|
ed2d1c7bf9 | ||
|
|
14b73cbd47 | ||
|
|
3124785a08 | ||
|
|
60e6306107 | ||
|
|
42ccb7830a | ||
|
|
0bb03b9292 | ||
|
|
ed6fbf1480 | ||
|
|
477cec6021 | ||
|
|
924500d111 | ||
|
|
0677504ef1 | ||
|
|
ca2a7c4d9c | ||
|
|
28606629ad | ||
|
|
c817279464 | ||
|
|
009d6ed8ed | ||
|
|
5cec1282a9 | ||
|
|
340170fd29 | ||
|
|
7ed0cc139a | ||
|
|
2c822213eb | ||
|
|
c08bb39ffe | ||
|
|
5083d8ab34 | ||
|
|
7552a5dd07 | ||
|
|
c93d68f853 | ||
|
|
3e8aa4023d | ||
|
|
b443875e66 |
@@ -68,6 +68,7 @@ func (s *Service) verifyBlkPreState(ctx context.Context, b interfaces.BeaconBloc
|
||||
// during initial syncing. There's no risk given a state summary object is just a
|
||||
// a subset of the block object.
|
||||
if !s.cfg.BeaconDB.HasStateSummary(ctx, parentRoot) && !s.cfg.BeaconDB.HasBlock(ctx, parentRoot) {
|
||||
log.Errorf("requesting blockroot %#x", bytesutil.Trunc(parentRoot[:]))
|
||||
return errors.New("could not reconstruct parent state")
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ func ValidatePayloadWhenMergeCompletes(st state.BeaconState, payload interfaces.
|
||||
return err
|
||||
}
|
||||
if !bytes.Equal(payload.ParentHash(), header.BlockHash()) {
|
||||
log.Errorf("parent Hash %#x, header Hash: %#x", bytesutil.Trunc(payload.ParentHash()), bytesutil.Trunc(header.BlockHash()))
|
||||
return ErrInvalidPayloadBlockHash
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -353,7 +353,7 @@ func ProcessRandaoMixesReset(state state.BeaconState) (state.BeaconState, error)
|
||||
}
|
||||
|
||||
// ProcessHistoricalDataUpdate processes the updates to historical data during epoch processing.
|
||||
// From Capella onward, per spec,state's historical summaries are updated instead of historical roots.
|
||||
// From Capella onward, per spec, state's historical summaries are updated instead of historical roots.
|
||||
func ProcessHistoricalDataUpdate(state state.BeaconState) (state.BeaconState, error) {
|
||||
currentEpoch := time.CurrentEpoch(state)
|
||||
nextEpoch := currentEpoch + 1
|
||||
|
||||
@@ -383,6 +383,7 @@ func (bs *Server) GetBlockV2(ctx context.Context, req *ethpbv2.BlockRequestV2) (
|
||||
if !errors.Is(err, blocks.ErrUnsupportedGetter) {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get signed beacon block: %v", err)
|
||||
}
|
||||
|
||||
return nil, status.Errorf(codes.Internal, "Unknown block type %T", blk)
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ go_library(
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/db/kv:go_default_library",
|
||||
"//beacon-chain/operations/attestations:go_default_library",
|
||||
"//beacon-chain/operations/blstoexec:go_default_library",
|
||||
"//beacon-chain/operations/synccommittee:go_default_library",
|
||||
"//beacon-chain/p2p:go_default_library",
|
||||
"//beacon-chain/rpc/eth/helpers:go_default_library",
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/blockchain"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/cache"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/attestations"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/blstoexec"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/synccommittee"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/p2p"
|
||||
v1alpha1validator "github.com/prysmaticlabs/prysm/v3/beacon-chain/rpc/prysm/v1alpha1/validator"
|
||||
@@ -24,6 +25,7 @@ type Server struct {
|
||||
StateFetcher statefetcher.Fetcher
|
||||
OptimisticModeFetcher blockchain.OptimisticModeFetcher
|
||||
SyncCommitteePool synccommittee.Pool
|
||||
BLSChangesPool blstoexec.PoolManager
|
||||
V1Alpha1Server *v1alpha1validator.Server
|
||||
ProposerSlotIndexCache *cache.ProposerPayloadIDsCache
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ go_library(
|
||||
"//beacon-chain/db/filters:go_default_library",
|
||||
"//beacon-chain/execution:go_default_library",
|
||||
"//beacon-chain/operations/attestations:go_default_library",
|
||||
"//beacon-chain/operations/blstoexec:go_default_library",
|
||||
"//beacon-chain/operations/slashings:go_default_library",
|
||||
"//beacon-chain/p2p:go_default_library",
|
||||
"//beacon-chain/state:go_default_library",
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/db"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/execution"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/attestations"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/blstoexec"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/slashings"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/p2p"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/state/stategen"
|
||||
@@ -40,6 +41,7 @@ type Server struct {
|
||||
Broadcaster p2p.Broadcaster
|
||||
AttestationsPool attestations.Pool
|
||||
SlashingsPool slashings.PoolManager
|
||||
BLSChangesPool blstoexec.PoolManager
|
||||
ChainStartChan chan time.Time
|
||||
ReceivedAttestationsBuffer chan *ethpb.Attestation
|
||||
CollectedAttestationsBuffer chan []*ethpb.Attestation
|
||||
|
||||
@@ -36,8 +36,8 @@ var eth1DataNotification bool
|
||||
const eth1dataTimeout = 2 * time.Second
|
||||
|
||||
// GetBeaconBlock is called by a proposer during its assigned slot to request a block to sign
|
||||
// by passing in the slot and the signed randao reveal of the slot. Returns phase0 beacon blocks
|
||||
// before the Altair fork epoch and Altair blocks post-fork epoch.
|
||||
// by passing in the slot and the signed randao reveal of the slot. Returns a full block
|
||||
// corresponding to the fork epoch
|
||||
func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "ProposerServer.GetBeaconBlock")
|
||||
defer span.End()
|
||||
|
||||
@@ -98,6 +98,7 @@ type Config struct {
|
||||
AttestationsPool attestations.Pool
|
||||
ExitPool voluntaryexits.PoolManager
|
||||
SlashingsPool slashings.PoolManager
|
||||
BLSToExecPool blstoexec.PoolManager
|
||||
SlashingChecker slasherservice.SlashingChecker
|
||||
SyncCommitteeObjectPool synccommittee.Pool
|
||||
BLSChangesPool blstoexec.PoolManager
|
||||
@@ -218,12 +219,12 @@ func (s *Service) Start() {
|
||||
SlashingsPool: s.cfg.SlashingsPool,
|
||||
StateGen: s.cfg.StateGen,
|
||||
SyncCommitteePool: s.cfg.SyncCommitteeObjectPool,
|
||||
BLSChangesPool: s.cfg.BLSChangesPool,
|
||||
ReplayerBuilder: ch,
|
||||
ExecutionEngineCaller: s.cfg.ExecutionEngineCaller,
|
||||
BeaconDB: s.cfg.BeaconDB,
|
||||
ProposerSlotIndexCache: s.cfg.ProposerIdsCache,
|
||||
BlockBuilder: s.cfg.BlockBuilder,
|
||||
BLSChangesPool: s.cfg.BLSChangesPool,
|
||||
}
|
||||
validatorServerV1 := &validator.Server{
|
||||
HeadFetcher: s.cfg.HeadFetcher,
|
||||
@@ -243,6 +244,7 @@ func (s *Service) Start() {
|
||||
ReplayerBuilder: ch,
|
||||
},
|
||||
SyncCommitteePool: s.cfg.SyncCommitteeObjectPool,
|
||||
BLSChangesPool: s.cfg.BLSChangesPool,
|
||||
ProposerSlotIndexCache: s.cfg.ProposerIdsCache,
|
||||
}
|
||||
|
||||
@@ -295,6 +297,7 @@ func (s *Service) Start() {
|
||||
ReceivedAttestationsBuffer: make(chan *ethpbv1alpha1.Attestation, attestationBufferSize),
|
||||
CollectedAttestationsBuffer: make(chan []*ethpbv1alpha1.Attestation, attestationBufferSize),
|
||||
ReplayerBuilder: ch,
|
||||
BLSChangesPool: s.cfg.BLSChangesPool,
|
||||
}
|
||||
beaconChainServerV1 := &beacon.Server{
|
||||
CanonicalHistory: ch,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package state_native
|
||||
|
||||
import (
|
||||
fieldparams "github.com/prysmaticlabs/prysm/v3/config/fieldparams"
|
||||
"github.com/prysmaticlabs/prysm/v3/config/params"
|
||||
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v3/encoding/bytesutil"
|
||||
@@ -49,7 +50,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, error) {
|
||||
b.lock.RLock()
|
||||
defer b.lock.RUnlock()
|
||||
|
||||
withdrawals := make([]*enginev1.Withdrawal, 0, params.BeaconConfig().MaxWithdrawalsPerPayload)
|
||||
withdrawals := make([]*enginev1.Withdrawal, 0, fieldparams.MaxWithdrawalsPerPayload)
|
||||
validatorIndex := b.nextWithdrawalValidatorIndex
|
||||
withdrawalIndex := b.nextWithdrawalIndex
|
||||
epoch := slots.ToEpoch(b.slot)
|
||||
@@ -75,7 +76,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, error) {
|
||||
})
|
||||
withdrawalIndex++
|
||||
}
|
||||
if uint64(len(withdrawals)) == params.BeaconConfig().MaxWithdrawalsPerPayload {
|
||||
if uint64(len(withdrawals)) == fieldparams.MaxWithdrawalsPerPayload {
|
||||
break
|
||||
}
|
||||
validatorIndex += 1
|
||||
|
||||
@@ -26,7 +26,7 @@ func TestNextWithdrawalIndex(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestLastWithdrawalValidatorIndex(t *testing.T) {
|
||||
func TestNextWithdrawalValidatorIndex(t *testing.T) {
|
||||
t.Run("ok", func(t *testing.T) {
|
||||
s := BeaconState{version: version.Capella, nextWithdrawalValidatorIndex: 123}
|
||||
i, err := s.NextWithdrawalValidatorIndex()
|
||||
|
||||
@@ -20,7 +20,7 @@ func (b *BeaconState) SetNextWithdrawalIndex(i uint64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetLastWithdrawalValidatorIndex sets the index of the validator which is
|
||||
// SetNexWithdrawalValidatorIndex sets the index of the validator which is
|
||||
// next in line for a partial withdrawal.
|
||||
func (b *BeaconState) SetNextWithdrawalValidatorIndex(i types.ValidatorIndex) error {
|
||||
if b.version < version.Capella {
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestSetNextWithdrawalIndex(t *testing.T) {
|
||||
require.Equal(t, true, s.dirtyFields[nativetypes.NextWithdrawalIndex])
|
||||
}
|
||||
|
||||
func TestSetLastWithdrawalValidatorIndex(t *testing.T) {
|
||||
func TestSetNextWithdrawalValidatorIndex(t *testing.T) {
|
||||
s := BeaconState{
|
||||
version: version.Capella,
|
||||
nextWithdrawalValidatorIndex: 3,
|
||||
|
||||
@@ -36,6 +36,7 @@ func SepoliaConfig() *BeaconChainConfig {
|
||||
cfg.CapellaForkVersion = []byte{0x90, 0x00, 0x00, 0x72}
|
||||
cfg.TerminalTotalDifficulty = "17000000000000000"
|
||||
cfg.DepositContractAddress = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"
|
||||
cfg.CapellaForkVersion = []byte{0x90, 0x00, 0x00, 0x72}
|
||||
cfg.InitializeForkSchedule()
|
||||
return cfg
|
||||
}
|
||||
|
||||
@@ -237,6 +237,29 @@ type ExecutionPayloadCapellaJSON struct {
|
||||
Withdrawals []*Withdrawal `json:"withdrawals"`
|
||||
}
|
||||
|
||||
type getPayloadV2ResponseJson struct {
|
||||
ExecutionPayload *executionPayloadCapellaJSON `json:"executionPayload"`
|
||||
BlockValue string `json:"blockValue"`
|
||||
}
|
||||
|
||||
type executionPayloadCapellaJSON struct {
|
||||
ParentHash *common.Hash `json:"parentHash"`
|
||||
FeeRecipient *common.Address `json:"feeRecipient"`
|
||||
StateRoot *common.Hash `json:"stateRoot"`
|
||||
ReceiptsRoot *common.Hash `json:"receiptsRoot"`
|
||||
LogsBloom *hexutil.Bytes `json:"logsBloom"`
|
||||
PrevRandao *common.Hash `json:"prevRandao"`
|
||||
BlockNumber *hexutil.Uint64 `json:"blockNumber"`
|
||||
GasLimit *hexutil.Uint64 `json:"gasLimit"`
|
||||
GasUsed *hexutil.Uint64 `json:"gasUsed"`
|
||||
Timestamp *hexutil.Uint64 `json:"timestamp"`
|
||||
ExtraData hexutil.Bytes `json:"extraData"`
|
||||
BaseFeePerGas string `json:"baseFeePerGas"`
|
||||
BlockHash *common.Hash `json:"blockHash"`
|
||||
Transactions []hexutil.Bytes `json:"transactions"`
|
||||
Withdrawals []*Withdrawal `json:"withdrawals"`
|
||||
}
|
||||
|
||||
// MarshalJSON --
|
||||
func (e *ExecutionPayload) MarshalJSON() ([]byte, error) {
|
||||
transactions := make([]hexutil.Bytes, len(e.Transactions))
|
||||
|
||||
14
proto/eth/ext/options.pb.go
generated
14
proto/eth/ext/options.pb.go
generated
@@ -9,9 +9,9 @@ package ext
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -23,7 +23,7 @@ const (
|
||||
|
||||
var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50000,
|
||||
Name: "ethereum.eth.ext.cast_type",
|
||||
@@ -31,7 +31,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
Filename: "proto/eth/ext/options.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50001,
|
||||
Name: "ethereum.eth.ext.ssz_size",
|
||||
@@ -39,7 +39,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
Filename: "proto/eth/ext/options.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50002,
|
||||
Name: "ethereum.eth.ext.ssz_max",
|
||||
@@ -47,7 +47,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
Filename: "proto/eth/ext/options.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50003,
|
||||
Name: "ethereum.eth.ext.spec_name",
|
||||
@@ -56,7 +56,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
// Extension fields to descriptor.FieldOptions.
|
||||
var (
|
||||
// optional string cast_type = 50000;
|
||||
E_CastType = &file_proto_eth_ext_options_proto_extTypes[0]
|
||||
@@ -103,7 +103,7 @@ var file_proto_eth_ext_options_proto_rawDesc = []byte{
|
||||
}
|
||||
|
||||
var file_proto_eth_ext_options_proto_goTypes = []interface{}{
|
||||
(*descriptorpb.FieldOptions)(nil), // 0: google.protobuf.FieldOptions
|
||||
(*descriptor.FieldOptions)(nil), // 0: google.protobuf.FieldOptions
|
||||
}
|
||||
var file_proto_eth_ext_options_proto_depIdxs = []int32{
|
||||
0, // 0: ethereum.eth.ext.cast_type:extendee -> google.protobuf.FieldOptions
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
github_com_prysmaticlabs_prysm_v3_consensus_types_primitives "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v3/proto/eth/v1"
|
||||
v1 "github.com/prysmaticlabs/prysm/v3/proto/eth/v1"
|
||||
"github.com/prysmaticlabs/prysm/v3/proto/eth/v2"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
github_com_prysmaticlabs_prysm_v3_consensus_types_primitives "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v3/proto/eth/v1"
|
||||
v1 "github.com/prysmaticlabs/prysm/v3/proto/eth/v1"
|
||||
"github.com/prysmaticlabs/prysm/v3/proto/eth/v2"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
github_com_prysmaticlabs_prysm_v3_consensus_types_primitives "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v3/proto/eth/v1"
|
||||
v1 "github.com/prysmaticlabs/prysm/v3/proto/eth/v1"
|
||||
"github.com/prysmaticlabs/prysm/v3/proto/eth/v2"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
@@ -54,7 +54,7 @@ message BeaconBlockContainerV2 {
|
||||
v1.BeaconBlock phase0_block = 1;
|
||||
BeaconBlockAltair altair_block = 2;
|
||||
BeaconBlockBellatrix bellatrix_block = 3;
|
||||
BeaconBlockCapella capella_block = 4;
|
||||
BeaconBlockCapella capella_block = 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ go_library(
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//beacon-chain/state:go_default_library",
|
||||
"//config/fieldparams:go_default_library",
|
||||
"//consensus-types/interfaces:go_default_library",
|
||||
"//crypto/hash:go_default_library",
|
||||
"//encoding/bytesutil:go_default_library",
|
||||
"//encoding/ssz:go_default_library",
|
||||
"//proto/engine/v1:go_default_library",
|
||||
|
||||
@@ -3,6 +3,8 @@ package migration
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/state"
|
||||
fieldparams "github.com/prysmaticlabs/prysm/v3/config/fieldparams"
|
||||
"github.com/prysmaticlabs/prysm/v3/crypto/hash"
|
||||
"github.com/prysmaticlabs/prysm/v3/encoding/bytesutil"
|
||||
"github.com/prysmaticlabs/prysm/v3/encoding/ssz"
|
||||
enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1"
|
||||
@@ -316,6 +318,201 @@ func V1Alpha1BeaconBlockBellatrixToV2Blinded(v1alpha1Block *ethpbalpha.BeaconBlo
|
||||
return v2Block, nil
|
||||
}
|
||||
|
||||
// V1Alpha1BeaconBlockCapellaToV2Blinded converts a v1alpha1 Capella beacon block to a v2
|
||||
// blinded Capella block.
|
||||
func V1Alpha1BeaconBlockCapellaToV2Blinded(v1alpha1Block *ethpbalpha.BeaconBlockCapella) (*ethpbv2.BlindedBeaconBlockCapella, error) {
|
||||
sourceProposerSlashings := v1alpha1Block.Body.ProposerSlashings
|
||||
resultProposerSlashings := make([]*ethpbv1.ProposerSlashing, len(sourceProposerSlashings))
|
||||
for i, s := range sourceProposerSlashings {
|
||||
resultProposerSlashings[i] = ðpbv1.ProposerSlashing{
|
||||
SignedHeader_1: ðpbv1.SignedBeaconBlockHeader{
|
||||
Message: ðpbv1.BeaconBlockHeader{
|
||||
Slot: s.Header_1.Header.Slot,
|
||||
ProposerIndex: s.Header_1.Header.ProposerIndex,
|
||||
ParentRoot: bytesutil.SafeCopyBytes(s.Header_1.Header.ParentRoot),
|
||||
StateRoot: bytesutil.SafeCopyBytes(s.Header_1.Header.StateRoot),
|
||||
BodyRoot: bytesutil.SafeCopyBytes(s.Header_1.Header.BodyRoot),
|
||||
},
|
||||
Signature: bytesutil.SafeCopyBytes(s.Header_1.Signature),
|
||||
},
|
||||
SignedHeader_2: ðpbv1.SignedBeaconBlockHeader{
|
||||
Message: ðpbv1.BeaconBlockHeader{
|
||||
Slot: s.Header_2.Header.Slot,
|
||||
ProposerIndex: s.Header_2.Header.ProposerIndex,
|
||||
ParentRoot: bytesutil.SafeCopyBytes(s.Header_2.Header.ParentRoot),
|
||||
StateRoot: bytesutil.SafeCopyBytes(s.Header_2.Header.StateRoot),
|
||||
BodyRoot: bytesutil.SafeCopyBytes(s.Header_2.Header.BodyRoot),
|
||||
},
|
||||
Signature: bytesutil.SafeCopyBytes(s.Header_2.Signature),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
sourceAttesterSlashings := v1alpha1Block.Body.AttesterSlashings
|
||||
resultAttesterSlashings := make([]*ethpbv1.AttesterSlashing, len(sourceAttesterSlashings))
|
||||
for i, s := range sourceAttesterSlashings {
|
||||
att1Indices := make([]uint64, len(s.Attestation_1.AttestingIndices))
|
||||
copy(att1Indices, s.Attestation_1.AttestingIndices)
|
||||
att2Indices := make([]uint64, len(s.Attestation_2.AttestingIndices))
|
||||
copy(att2Indices, s.Attestation_2.AttestingIndices)
|
||||
resultAttesterSlashings[i] = ðpbv1.AttesterSlashing{
|
||||
Attestation_1: ðpbv1.IndexedAttestation{
|
||||
AttestingIndices: att1Indices,
|
||||
Data: ðpbv1.AttestationData{
|
||||
Slot: s.Attestation_1.Data.Slot,
|
||||
Index: s.Attestation_1.Data.CommitteeIndex,
|
||||
BeaconBlockRoot: bytesutil.SafeCopyBytes(s.Attestation_1.Data.BeaconBlockRoot),
|
||||
Source: ðpbv1.Checkpoint{
|
||||
Epoch: s.Attestation_1.Data.Source.Epoch,
|
||||
Root: bytesutil.SafeCopyBytes(s.Attestation_1.Data.Source.Root),
|
||||
},
|
||||
Target: ðpbv1.Checkpoint{
|
||||
Epoch: s.Attestation_1.Data.Target.Epoch,
|
||||
Root: bytesutil.SafeCopyBytes(s.Attestation_1.Data.Target.Root),
|
||||
},
|
||||
},
|
||||
Signature: bytesutil.SafeCopyBytes(s.Attestation_1.Signature),
|
||||
},
|
||||
Attestation_2: ðpbv1.IndexedAttestation{
|
||||
AttestingIndices: att2Indices,
|
||||
Data: ðpbv1.AttestationData{
|
||||
Slot: s.Attestation_2.Data.Slot,
|
||||
Index: s.Attestation_2.Data.CommitteeIndex,
|
||||
BeaconBlockRoot: bytesutil.SafeCopyBytes(s.Attestation_2.Data.BeaconBlockRoot),
|
||||
Source: ðpbv1.Checkpoint{
|
||||
Epoch: s.Attestation_2.Data.Source.Epoch,
|
||||
Root: bytesutil.SafeCopyBytes(s.Attestation_2.Data.Source.Root),
|
||||
},
|
||||
Target: ðpbv1.Checkpoint{
|
||||
Epoch: s.Attestation_2.Data.Target.Epoch,
|
||||
Root: bytesutil.SafeCopyBytes(s.Attestation_2.Data.Target.Root),
|
||||
},
|
||||
},
|
||||
Signature: bytesutil.SafeCopyBytes(s.Attestation_2.Signature),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
sourceAttestations := v1alpha1Block.Body.Attestations
|
||||
resultAttestations := make([]*ethpbv1.Attestation, len(sourceAttestations))
|
||||
for i, a := range sourceAttestations {
|
||||
resultAttestations[i] = ðpbv1.Attestation{
|
||||
AggregationBits: bytesutil.SafeCopyBytes(a.AggregationBits),
|
||||
Data: ðpbv1.AttestationData{
|
||||
Slot: a.Data.Slot,
|
||||
Index: a.Data.CommitteeIndex,
|
||||
BeaconBlockRoot: bytesutil.SafeCopyBytes(a.Data.BeaconBlockRoot),
|
||||
Source: ðpbv1.Checkpoint{
|
||||
Epoch: a.Data.Source.Epoch,
|
||||
Root: bytesutil.SafeCopyBytes(a.Data.Source.Root),
|
||||
},
|
||||
Target: ðpbv1.Checkpoint{
|
||||
Epoch: a.Data.Target.Epoch,
|
||||
Root: bytesutil.SafeCopyBytes(a.Data.Target.Root),
|
||||
},
|
||||
},
|
||||
Signature: bytesutil.SafeCopyBytes(a.Signature),
|
||||
}
|
||||
}
|
||||
|
||||
sourceDeposits := v1alpha1Block.Body.Deposits
|
||||
resultDeposits := make([]*ethpbv1.Deposit, len(sourceDeposits))
|
||||
for i, d := range sourceDeposits {
|
||||
resultDeposits[i] = ðpbv1.Deposit{
|
||||
Proof: bytesutil.SafeCopy2dBytes(d.Proof),
|
||||
Data: ðpbv1.Deposit_Data{
|
||||
Pubkey: bytesutil.SafeCopyBytes(d.Data.PublicKey),
|
||||
WithdrawalCredentials: bytesutil.SafeCopyBytes(d.Data.WithdrawalCredentials),
|
||||
Amount: d.Data.Amount,
|
||||
Signature: bytesutil.SafeCopyBytes(d.Data.Signature),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
sourceExits := v1alpha1Block.Body.VoluntaryExits
|
||||
resultExits := make([]*ethpbv1.SignedVoluntaryExit, len(sourceExits))
|
||||
for i, e := range sourceExits {
|
||||
resultExits[i] = ðpbv1.SignedVoluntaryExit{
|
||||
Message: ðpbv1.VoluntaryExit{
|
||||
Epoch: e.Exit.Epoch,
|
||||
ValidatorIndex: e.Exit.ValidatorIndex,
|
||||
},
|
||||
Signature: bytesutil.SafeCopyBytes(e.Signature),
|
||||
}
|
||||
}
|
||||
|
||||
transactionsRoot, err := ssz.TransactionsRoot(v1alpha1Block.Body.ExecutionPayload.Transactions)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "could not calculate transactions root")
|
||||
}
|
||||
|
||||
withdrawalsRoot, err := ssz.WithdrawalSliceRoot(
|
||||
hash.CustomSHA256Hasher(),
|
||||
v1alpha1Block.Body.ExecutionPayload.Withdrawals,
|
||||
fieldparams.MaxWithdrawalsPerPayload,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "could not calculate transactions root")
|
||||
}
|
||||
|
||||
changes := make([]*ethpbv2.SignedBLSToExecutionChange, len(v1alpha1Block.Body.BlsToExecutionChanges))
|
||||
for i, change := range v1alpha1Block.Body.BlsToExecutionChanges {
|
||||
changes[i] = ðpbv2.SignedBLSToExecutionChange{
|
||||
Message: ðpbv2.BLSToExecutionChange{
|
||||
ValidatorIndex: change.Message.ValidatorIndex,
|
||||
FromBlsPubkey: bytesutil.SafeCopyBytes(change.Message.FromBlsPubkey),
|
||||
ToExecutionAddress: bytesutil.SafeCopyBytes(change.Message.ToExecutionAddress),
|
||||
},
|
||||
Signature: bytesutil.SafeCopyBytes(change.Signature),
|
||||
}
|
||||
}
|
||||
|
||||
resultBlockBody := ðpbv2.BlindedBeaconBlockBodyCapella{
|
||||
RandaoReveal: bytesutil.SafeCopyBytes(v1alpha1Block.Body.RandaoReveal),
|
||||
Eth1Data: ðpbv1.Eth1Data{
|
||||
DepositRoot: bytesutil.SafeCopyBytes(v1alpha1Block.Body.Eth1Data.DepositRoot),
|
||||
DepositCount: v1alpha1Block.Body.Eth1Data.DepositCount,
|
||||
BlockHash: bytesutil.SafeCopyBytes(v1alpha1Block.Body.Eth1Data.BlockHash),
|
||||
},
|
||||
Graffiti: bytesutil.SafeCopyBytes(v1alpha1Block.Body.Graffiti),
|
||||
ProposerSlashings: resultProposerSlashings,
|
||||
AttesterSlashings: resultAttesterSlashings,
|
||||
Attestations: resultAttestations,
|
||||
Deposits: resultDeposits,
|
||||
VoluntaryExits: resultExits,
|
||||
SyncAggregate: ðpbv1.SyncAggregate{
|
||||
SyncCommitteeBits: bytesutil.SafeCopyBytes(v1alpha1Block.Body.SyncAggregate.SyncCommitteeBits),
|
||||
SyncCommitteeSignature: bytesutil.SafeCopyBytes(v1alpha1Block.Body.SyncAggregate.SyncCommitteeSignature),
|
||||
},
|
||||
ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderCapella{
|
||||
ParentHash: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.ParentHash),
|
||||
FeeRecipient: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.FeeRecipient),
|
||||
StateRoot: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.StateRoot),
|
||||
ReceiptsRoot: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.ReceiptsRoot),
|
||||
LogsBloom: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.LogsBloom),
|
||||
PrevRandao: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.PrevRandao),
|
||||
BlockNumber: v1alpha1Block.Body.ExecutionPayload.BlockNumber,
|
||||
GasLimit: v1alpha1Block.Body.ExecutionPayload.GasLimit,
|
||||
GasUsed: v1alpha1Block.Body.ExecutionPayload.GasUsed,
|
||||
Timestamp: v1alpha1Block.Body.ExecutionPayload.Timestamp,
|
||||
ExtraData: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.ExtraData),
|
||||
BaseFeePerGas: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.BaseFeePerGas),
|
||||
BlockHash: bytesutil.SafeCopyBytes(v1alpha1Block.Body.ExecutionPayload.BlockHash),
|
||||
TransactionsRoot: transactionsRoot[:],
|
||||
WithdrawalsRoot: withdrawalsRoot[:],
|
||||
},
|
||||
BlsToExecutionChanges: changes,
|
||||
}
|
||||
v2Block := ðpbv2.BlindedBeaconBlockCapella{
|
||||
Slot: v1alpha1Block.Slot,
|
||||
ProposerIndex: v1alpha1Block.ProposerIndex,
|
||||
ParentRoot: bytesutil.SafeCopyBytes(v1alpha1Block.ParentRoot),
|
||||
StateRoot: bytesutil.SafeCopyBytes(v1alpha1Block.StateRoot),
|
||||
Body: resultBlockBody,
|
||||
}
|
||||
return v2Block, nil
|
||||
}
|
||||
|
||||
// BeaconStateAltairToProto converts a state.BeaconState object to its protobuf equivalent.
|
||||
func BeaconStateAltairToProto(altairState state.BeaconState) (*ethpbv2.BeaconState, error) {
|
||||
sourceFork := altairState.Fork()
|
||||
|
||||
1
proto/prysm/storage/beacon_storage.pb.go
generated
1
proto/prysm/storage/beacon_storage.pb.go
generated
@@ -27,6 +27,7 @@ type BeaconStateForStorage struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to StorageState:
|
||||
//
|
||||
// *BeaconStateForStorage_StateV1
|
||||
StorageState isBeaconStateForStorage_StorageState `protobuf_oneof:"storageState"`
|
||||
}
|
||||
|
||||
2
proto/prysm/v1alpha1/beacon_block.pb.go
generated
2
proto/prysm/v1alpha1/beacon_block.pb.go
generated
@@ -31,6 +31,7 @@ type GenericSignedBeaconBlock struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Block:
|
||||
//
|
||||
// *GenericSignedBeaconBlock_Phase0
|
||||
// *GenericSignedBeaconBlock_Altair
|
||||
// *GenericSignedBeaconBlock_Bellatrix
|
||||
@@ -167,6 +168,7 @@ type GenericBeaconBlock struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Block:
|
||||
//
|
||||
// *GenericBeaconBlock_Phase0
|
||||
// *GenericBeaconBlock_Altair
|
||||
// *GenericBeaconBlock_Bellatrix
|
||||
|
||||
@@ -258,6 +258,7 @@ service BeaconChain {
|
||||
get: "/eth/v1alpha1/beacon/individual_votes"
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// SetAction defines the type of action that should be applied to the keys in a validator change set.
|
||||
@@ -834,6 +835,7 @@ message SubmitSlashingResponse {
|
||||
repeated uint64 slashed_indices = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
|
||||
}
|
||||
|
||||
|
||||
message IndividualVotesRequest {
|
||||
// Epoch of the request.
|
||||
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
|
||||
@@ -880,4 +882,4 @@ message IndividualVotesRespond {
|
||||
}
|
||||
|
||||
repeated IndividualVote individual_votes = 1;
|
||||
}
|
||||
}
|
||||
|
||||
1
proto/prysm/v1alpha1/debug.pb.go
generated
1
proto/prysm/v1alpha1/debug.pb.go
generated
@@ -186,6 +186,7 @@ type BeaconStateRequest struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to QueryFilter:
|
||||
//
|
||||
// *BeaconStateRequest_Slot
|
||||
// *BeaconStateRequest_BlockRoot
|
||||
QueryFilter isBeaconStateRequest_QueryFilter `protobuf_oneof:"query_filter"`
|
||||
|
||||
@@ -138,6 +138,7 @@ type SignRequest struct {
|
||||
SigningRoot []byte `protobuf:"bytes,2,opt,name=signing_root,json=signingRoot,proto3" json:"signing_root,omitempty"`
|
||||
SignatureDomain []byte `protobuf:"bytes,3,opt,name=signature_domain,json=signatureDomain,proto3" json:"signature_domain,omitempty"`
|
||||
// Types that are assignable to Object:
|
||||
//
|
||||
// *SignRequest_Block
|
||||
// *SignRequest_AttestationData
|
||||
// *SignRequest_AggregateAttestationAndProof
|
||||
|
||||
@@ -44,5 +44,3 @@ message SignedBLSToExecutionChange {
|
||||
// The 96 byte BLS signature from the withdrawal address requesting the change
|
||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ go_library(
|
||||
"//proto/engine/v1:go_default_library",
|
||||
"//proto/prysm/v1alpha1:go_default_library",
|
||||
"//time:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
|
||||
"@com_github_pkg_errors//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
package interop
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"log"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v3/async"
|
||||
"github.com/prysmaticlabs/prysm/v3/beacon-chain/core/signing"
|
||||
@@ -36,9 +40,27 @@ func GenerateGenesisState(ctx context.Context, genesisTime, numValidators uint64
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "could not generate deposit data from keys")
|
||||
}
|
||||
if err := outputPrivateKeys(privKeys); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return GenerateGenesisStateFromDepositData(ctx, genesisTime, depositDataItems, depositDataRoots)
|
||||
}
|
||||
|
||||
func outputPrivateKeys(keys []bls.SecretKey) error {
|
||||
f, err := os.Create("/tmp/privkeys")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
w := bufio.NewWriter(f)
|
||||
for _, key := range keys {
|
||||
if _, err := w.WriteString(hexutil.Encode(key.Marshal()) + "\n"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
log.Printf("Done writing genesis state to /tmp/privkeys")
|
||||
return w.Flush()
|
||||
}
|
||||
|
||||
// GenerateGenesisStateFromDepositData creates a genesis state given a list of
|
||||
// deposit data items and their corresponding roots.
|
||||
func GenerateGenesisStateFromDepositData(
|
||||
@@ -193,5 +215,5 @@ func createDepositData(privKey bls.SecretKey, pubKey bls.PublicKey) (*ethpb.Depo
|
||||
// where withdrawal_credentials is of type bytes32.
|
||||
func withdrawalCredentialsHash(pubKey []byte) []byte {
|
||||
h := hash.Hash(pubKey)
|
||||
return append([]byte{blsWithdrawalPrefixByte}, h[1:]...)[:32]
|
||||
return append([]byte{0}, h[1:]...)[:32]
|
||||
}
|
||||
|
||||
@@ -13,10 +13,6 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/v3/crypto/hash"
|
||||
)
|
||||
|
||||
const (
|
||||
blsWithdrawalPrefixByte = byte(0)
|
||||
)
|
||||
|
||||
// DeterministicallyGenerateKeys creates BLS private keys using a fixed curve order according to
|
||||
// the algorithm specified in the Ethereum beacon chain specification interop mock start section found here:
|
||||
// https://github.com/ethereum/eth2.0-pm/blob/a085c9870f3956d6228ed2a40cd37f0c6580ecd7/interop/mocked_start/README.md
|
||||
|
||||
@@ -8,6 +8,6 @@ import (
|
||||
)
|
||||
|
||||
func TestEndToEnd_MinimalConfig(t *testing.T) {
|
||||
r := e2eMinimal(t, version.Phase0, types.WithCheckpointSync())
|
||||
r := e2eMinimal(t, version.Capella, types.WithCheckpointSync())
|
||||
r.run()
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package forkchoice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
@@ -81,15 +82,20 @@ type engineMock struct {
|
||||
func (m *engineMock) GetPayload(context.Context, [8]byte, types.Slot) (interfaces.ExecutionData, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *engineMock) GetPayloadV2(context.Context, [8]byte) (*pb.ExecutionPayloadCapella, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (m *engineMock) ForkchoiceUpdated(context.Context, *pb.ForkchoiceState, payloadattribute.Attributer) (*pb.PayloadIDBytes, []byte, error) {
|
||||
return nil, m.latestValidHash, m.payloadStatus
|
||||
}
|
||||
func (m *engineMock) ForkchoiceUpdatedV2(context.Context, *pb.ForkchoiceState, *pb.PayloadAttributesV2) (*pb.PayloadIDBytes, []byte, error) {
|
||||
return nil, m.latestValidHash, m.payloadStatus
|
||||
}
|
||||
func (m *engineMock) NewPayload(context.Context, interfaces.ExecutionData) ([]byte, error) {
|
||||
return m.latestValidHash, m.payloadStatus
|
||||
}
|
||||
|
||||
func (m *engineMock) LatestExecutionBlock() (*pb.ExecutionBlock, error) {
|
||||
func (m *engineMock) LatestExecutionBlock(context.Context) (*pb.ExecutionBlock, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -103,7 +109,7 @@ func (m *engineMock) ExecutionBlockByHash(_ context.Context, hash common.Hash, _
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
td := bytesutil.LittleEndianBytesToBigInt(b.TotalDifficulty)
|
||||
td := new(big.Int).SetBytes(bytesutil.ReverseByteOrder(b.TotalDifficulty))
|
||||
tdHex := hexutil.EncodeBig(td)
|
||||
return &pb.ExecutionBlock{
|
||||
Header: gethtypes.Header{
|
||||
|
||||
@@ -167,6 +167,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
|
||||
if p.GasLimit() != 0 {
|
||||
log = log.WithField("gasUtilized", float64(p.GasUsed())/float64(p.GasLimit()))
|
||||
}
|
||||
|
||||
if blk.Version() >= version.Capella && !blk.IsBlinded() {
|
||||
withdrawals, err := p.Withdrawals()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user