mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
strip 26 dead serialize:"true" tags (message/validators/warp)
The message/validators/warp marshalers are hand-rolled per-type packers (marshalValue type switch) that ignore struct tags — the linearcodec that read them is gone. Pure dead metadata. Golden round-trip tests green (byte-identical). Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -18,9 +18,9 @@ var (
|
||||
|
||||
// BlockRequest is a request to retrieve Parents number of blocks starting from Hash from newest-oldest manner
|
||||
type BlockRequest struct {
|
||||
Hash common.Hash `serialize:"true"`
|
||||
Height uint64 `serialize:"true"`
|
||||
Parents uint16 `serialize:"true"`
|
||||
Hash common.Hash
|
||||
Height uint64
|
||||
Parents uint16
|
||||
}
|
||||
|
||||
func (b BlockRequest) String() string {
|
||||
@@ -39,5 +39,5 @@ func (b BlockRequest) Handle(ctx context.Context, nodeID ids.NodeID, requestID u
|
||||
// requested in BlockRequest.Hash. The next block is the parent, etc.
|
||||
// handler: handlers.BlockRequestHandler
|
||||
type BlockResponse struct {
|
||||
Blocks [][]byte `serialize:"true"`
|
||||
Blocks [][]byte
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ var _ Request = CodeRequest{}
|
||||
// CodeRequest is a request to retrieve a contract code with specified Hash
|
||||
type CodeRequest struct {
|
||||
// Hashes is a list of contract code hashes
|
||||
Hashes []common.Hash `serialize:"true"`
|
||||
Hashes []common.Hash
|
||||
}
|
||||
|
||||
func (c CodeRequest) String() string {
|
||||
@@ -43,5 +43,5 @@ func NewCodeRequest(hashes []common.Hash) CodeRequest {
|
||||
// the corresponding element in CodeRequest.Hashes
|
||||
// handler: handlers.CodeRequestHandler
|
||||
type CodeResponse struct {
|
||||
Data [][]byte `serialize:"true"`
|
||||
Data [][]byte
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ var _ Request = LeafsRequest{}
|
||||
// LeafsRequest is a request to receive trie leaves at specified Root within Start and End byte range
|
||||
// Limit outlines maximum number of leaves to returns starting at Start
|
||||
type LeafsRequest struct {
|
||||
Root common.Hash `serialize:"true"`
|
||||
Account common.Hash `serialize:"true"`
|
||||
Start []byte `serialize:"true"`
|
||||
End []byte `serialize:"true"`
|
||||
Limit uint16 `serialize:"true"`
|
||||
Root common.Hash
|
||||
Account common.Hash
|
||||
Start []byte
|
||||
End []byte
|
||||
Limit uint16
|
||||
}
|
||||
|
||||
func (l LeafsRequest) String() string {
|
||||
@@ -48,8 +48,8 @@ func (l LeafsRequest) Handle(ctx context.Context, nodeID ids.NodeID, requestID u
|
||||
// pair in the response has any more elements to its right within the trie.
|
||||
type LeafsResponse struct {
|
||||
// Keys and Vals provides the key-value pairs in the trie in the response.
|
||||
Keys [][]byte `serialize:"true"`
|
||||
Vals [][]byte `serialize:"true"`
|
||||
Keys [][]byte
|
||||
Vals [][]byte
|
||||
|
||||
// More indicates if there are more leaves to the right of the last value in this response.
|
||||
//
|
||||
@@ -60,5 +60,5 @@ type LeafsResponse struct {
|
||||
|
||||
// ProofVals contain the edge merkle-proofs for the range of keys included in the response.
|
||||
// The keys for the proof are simply the keccak256 hashes of the values, so they are not included in the response to save bandwidth.
|
||||
ProofVals [][]byte `serialize:"true"`
|
||||
ProofVals [][]byte
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ import (
|
||||
// SyncSummary provides the information necessary to sync a node starting
|
||||
// at the given block.
|
||||
type SyncSummary struct {
|
||||
BlockNumber uint64 `serialize:"true"`
|
||||
BlockHash common.Hash `serialize:"true"`
|
||||
BlockRoot common.Hash `serialize:"true"`
|
||||
BlockNumber uint64
|
||||
BlockHash common.Hash
|
||||
BlockRoot common.Hash
|
||||
|
||||
summaryID ids.ID
|
||||
bytes []byte
|
||||
|
||||
@@ -29,13 +29,13 @@ const (
|
||||
)
|
||||
|
||||
type validatorData struct {
|
||||
UpDuration time.Duration `serialize:"true"`
|
||||
LastUpdated uint64 `serialize:"true"`
|
||||
NodeID ids.NodeID `serialize:"true"`
|
||||
Weight uint64 `serialize:"true"`
|
||||
StartTime uint64 `serialize:"true"`
|
||||
IsActive bool `serialize:"true"`
|
||||
IsL1Validator bool `serialize:"true"`
|
||||
UpDuration time.Duration
|
||||
LastUpdated uint64
|
||||
NodeID ids.NodeID
|
||||
Weight uint64
|
||||
StartTime uint64
|
||||
IsActive bool
|
||||
IsL1Validator bool
|
||||
|
||||
validationID ids.ID // database key
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
// ValidatorUptime is signed when the ValidationID is known and the validator
|
||||
// has been up for TotalUptime seconds.
|
||||
type ValidatorUptime struct {
|
||||
ValidationID ids.ID `serialize:"true"`
|
||||
TotalUptime uint64 `serialize:"true"` // in seconds
|
||||
ValidationID ids.ID
|
||||
TotalUptime uint64 // in seconds
|
||||
|
||||
bytes []byte
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user