-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Deneb - web3signer #12767
Deneb - web3signer #12767
Conversation
fc45d3b
to
963fefc
Compare
963fefc
to
ce697f3
Compare
7b5fdfa
to
e166e5d
Compare
77aac60
to
e0f7eb8
Compare
f6476a9
to
70143ef
Compare
039d792
to
f05526a
Compare
encoding/ssz/htrutils.go
Outdated
func transactionRoot(tx []byte) ([32]byte, error) { | ||
chunkedRoots, err := PackByChunk([][]byte{tx}) | ||
// ByteSliceRoot is a helper func to merkleize an arbitrary List[Byte, N] | ||
// this func runs Chunkify + MerkleizeVector | ||
func ByteSliceRoot(slice []byte) ([32]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there no tests for this method? Surprised you could rename it without breaking tests 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm your concern here is probably valid I'll double check with kasey and potuz 😅
return json.Marshal(blobRequest) | ||
} | ||
|
||
func handleBlindedBlob(ctx context.Context, validator *validator.Validate, request *validatorpb.SignRequest, genesisValidatorsRoot []byte) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
genesisValidatorsRoot is not used, is this to conform to some interface? Several methods in this file that have unused params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good point I can probably remove, i had to make this function because of the linter cognit I can remove for many of these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof ok it actually needs the fork info so thanks for catching
@@ -337,6 +345,18 @@ type ValidatorRegistration struct { | |||
Pubkey hexutil.Bytes `json:"pubkey" validate:"required"` /* bls hexadecimal string */ | |||
} | |||
|
|||
// BlobSidecar a sub property of BlobSidecarSignRequest | |||
type BlobSidecar struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be blind blob sidecar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is as the web3signer defines (not builder) ethereum/remote-signing-api#4
rawYaml = append(rawYaml, []byte(depContractStr)...) | ||
rawYaml = append(rawYaml, params.NetworkConfigToYaml(params.BeaconNetworkConfig())...) | ||
|
||
rawYaml = append(rawYaml, []byte("\nEPOCHS_PER_SUBNET_SUBSCRIPTION: 256\n")...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should I do with this? should i update config to yaml to include network properties? and should these be included to the network configs?
related to ethereum/consensus-specs#3375 and #12864
encoding/ssz/htrutils.go
Outdated
|
||
maxLength := (fieldparams.MaxBytesPerTxLength + 31) / 32 | ||
bytesRoot, err := BitwiseMerkleize(chunkedRoots, uint64(len(chunkedRoots)), uint64(maxLength)) | ||
maxRootLength := maxLength / fieldparams.RootLength |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks odd, the reason we did
(value + 31)/32
is so that the ending chunk if it isnt fully occupied ( < 32 bytes) is still
correctly addressed as 1 full chunk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me revert this then, maybe there's a better way to do this
return json.Marshal(randaoRevealSignRequest) | ||
} | ||
|
||
func handleExit(ctx context.Context, validator *validator.Validate, request *validatorpb.SignRequest, genesisValidatorsRoot []byte) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, should this be more like handleVoluntaryExit
return json.Marshal(aggregateAndProofSignRequest) | ||
} | ||
|
||
func handleSlot(ctx context.Context, validator *validator.Validate, request *validatorpb.SignRequest, genesisValidatorsRoot []byte) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit pick but this sounds less descriptive than the other handlers, should it be more like handleAggregationSlot
|
||
maxLength := (fieldparams.MaxBytesPerTxLength + 31) / 32 | ||
bytesRoot, err := BitwiseMerkleize(chunkedRoots, uint64(len(chunkedRoots)), uint64(maxLength)) | ||
maxRootLength := (maxLength + 31) / 32 // nearest number divisible by root length (32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment as to why we are doing + 31
and since 32
is the root length would it be better to minimize the magic numbers and have a const for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(value + 31)/32
is so that the ending chunk if it isnt fully occupied ( < 32 bytes) is still
correctly addressed as 1 full chunk.
potuz and nishant gave me this info.
i added the comment to represent this, any other opinions on making this clearer?
Co-authored-by: Sammy Rosso <[email protected]>
Co-authored-by: Sammy Rosso <[email protected]>
cmd/beacon-chain/tosaccepted
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file
What type of PR is this?
Feature
What does this PR do? Why is it needed?
implements web3signer requirements for deneb
Webhooks defined here ethereum/remote-signing-api#4
Which issues(s) does this PR fix?
part of #12248 and tracked in #9994