Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Badger Hardfork: BeaconStateBadger, BeaconBlockBadger #74

Merged
merged 35 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
aba2fb1
Add missing fork version/epoch
syjn99 Jan 14, 2025
13551e2
Skipping the failing assertion: will be fixed in the next PR
syjn99 Jan 15, 2025
44c2a22
Add type alias: BeaconStateBadger
syjn99 Jan 15, 2025
5c704aa
Add upgrade to Badger
syjn99 Jan 15, 2025
6ee04f9
Add badger key in db/kv & Add arm for badger in marshalling state
syjn99 Jan 15, 2025
ab0f18b
Add badger state for api/server/structs
syjn99 Jan 15, 2025
f069751
Add missing state related things
syjn99 Jan 15, 2025
cf18b17
Add HackForksMaxuint for test
syjn99 Jan 15, 2025
e0e8f13
Add badger for debug/handlers.go
syjn99 Jan 15, 2025
eb15578
Add badger for testing/util/attestation.go
syjn99 Jan 15, 2025
48e585e
Fix test: TestReplayBlocks_ThroughFutureForkBoundaries
syjn99 Jan 15, 2025
b37ddf1
Fix TestHostIsResolved: IP was changed
syjn99 Jan 15, 2025
59e3170
Add object mapping for badger
syjn99 Jan 15, 2025
0310c9d
Add BeaconBlock type in Badger: re-define in Badger
syjn99 Jan 16, 2025
2dde3ef
Add badger for consensus-types package
syjn99 Jan 16, 2025
ae807aa
Add badger for encoding/ssz/detect package
syjn99 Jan 16, 2025
96312cd
Fix TestHostIsResolved: this test is dependent to example.org
syjn99 Jan 16, 2025
7ae205c
Add NewBeaconBlockBadger series in testing/merge.go
syjn99 Jan 16, 2025
cb09f79
Add NewBeaconBlockBadger series in testing/util/block.go
syjn99 Jan 16, 2025
9dfa818
Add Badger for runtime/interop/premine-state.go
syjn99 Jan 16, 2025
67d82a0
Add Badger for beacon-chain/db/kv
syjn99 Jan 16, 2025
a13fbe1
Add alias for beacon-chain/rpc/eth/shared/testing/json.go
syjn99 Jan 16, 2025
6d875d2
Add badger for beacon-chain/sync package
syjn99 Jan 16, 2025
5d6e853
Add badger for beacon-chain/rpc/eth/validator package
syjn99 Jan 16, 2025
d1e378b
Add badger for beacon-chain/p2p package
syjn99 Jan 16, 2025
b6b9b67
Add badger for testing/util folder
syjn99 Jan 16, 2025
69febb3
Add badger for beacon-chain/execution package
syjn99 Jan 16, 2025
22bde04
Add badger for beacon-chain/rpc/prysm/v1alpha1/validator package
syjn99 Jan 16, 2025
4de6bfb
Add badger for api/server/structs package
syjn99 Jan 16, 2025
0a9756b
Add badger for beacon-chain/rpc/eth/beacon package
syjn99 Jan 16, 2025
5b68423
Add badger for validator/client package
syjn99 Jan 16, 2025
24d1ba3
Use badger for blinded blocks
syjn99 Jan 16, 2025
10e8815
Empty commit for triggering CI
syjn99 Feb 4, 2025
926a8d3
Remove eth/v2 things
syjn99 Feb 4, 2025
2b301de
Gofmt
syjn99 Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions api/server/structs/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,92 @@ type BlindedBeaconBlockBodyElectra struct {
ExecutionRequests *ExecutionRequests `json:"execution_requests"`
}

type SignedBeaconBlockContentsBadger struct {
SignedBlock *SignedBeaconBlockBadger `json:"signed_block"`
KzgProofs []string `json:"kzg_proofs"`
Blobs []string `json:"blobs"`
}

type BeaconBlockContentsBadger struct {
Block *BeaconBlockBadger `json:"block"`
KzgProofs []string `json:"kzg_proofs"`
Blobs []string `json:"blobs"`
}

type SignedBeaconBlockBadger struct {
Message *BeaconBlockBadger `json:"message"`
Signature string `json:"signature"`
}

var _ SignedMessageJsoner = &SignedBeaconBlockBadger{}

func (s *SignedBeaconBlockBadger) MessageRawJson() ([]byte, error) {
return json.Marshal(s.Message)
}

func (s *SignedBeaconBlockBadger) SigString() string {
return s.Signature
}

type BeaconBlockBadger struct {
Slot string `json:"slot"`
ProposerIndex string `json:"proposer_index"`
ParentRoot string `json:"parent_root"`
StateRoot string `json:"state_root"`
Body *BeaconBlockBodyBadger `json:"body"`
}

type BeaconBlockBodyBadger struct {
RandaoReveal string `json:"randao_reveal"`
Eth1Data *Eth1Data `json:"eth1_data"`
Graffiti string `json:"graffiti"`
ProposerSlashings []*ProposerSlashing `json:"proposer_slashings"`
AttesterSlashings []*AttesterSlashingElectra `json:"attester_slashings"`
Attestations []*AttestationElectra `json:"attestations"`
Deposits []*Deposit `json:"deposits"`
VoluntaryExits []*SignedVoluntaryExit `json:"voluntary_exits"`
ExecutionPayload *ExecutionPayloadDeneb `json:"execution_payload"`
BlobKzgCommitments []string `json:"blob_kzg_commitments"`
ExecutionRequests *ExecutionRequests `json:"execution_requests"`
}

type BlindedBeaconBlockBadger struct {
Slot string `json:"slot"`
ProposerIndex string `json:"proposer_index"`
ParentRoot string `json:"parent_root"`
StateRoot string `json:"state_root"`
Body *BlindedBeaconBlockBodyBadger `json:"body"`
}

type SignedBlindedBeaconBlockBadger struct {
Message *BlindedBeaconBlockBadger `json:"message"`
Signature string `json:"signature"`
}

var _ SignedMessageJsoner = &SignedBlindedBeaconBlockBadger{}

func (s *SignedBlindedBeaconBlockBadger) MessageRawJson() ([]byte, error) {
return json.Marshal(s.Message)
}

func (s *SignedBlindedBeaconBlockBadger) SigString() string {
return s.Signature
}

type BlindedBeaconBlockBodyBadger struct {
RandaoReveal string `json:"randao_reveal"`
Eth1Data *Eth1Data `json:"eth1_data"`
Graffiti string `json:"graffiti"`
ProposerSlashings []*ProposerSlashing `json:"proposer_slashings"`
AttesterSlashings []*AttesterSlashingElectra `json:"attester_slashings"`
Attestations []*AttestationElectra `json:"attestations"`
Deposits []*Deposit `json:"deposits"`
VoluntaryExits []*SignedVoluntaryExit `json:"voluntary_exits"`
ExecutionPayloadHeader *ExecutionPayloadHeaderDeneb `json:"execution_payload_header"`
BlobKzgCommitments []string `json:"blob_kzg_commitments"`
ExecutionRequests *ExecutionRequests `json:"execution_requests"`
}

type SignedBeaconBlockHeaderContainer struct {
Header *SignedBeaconBlockHeader `json:"header"`
Root string `json:"root"`
Expand Down
Loading
Loading