-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remote Signer: Electra #14477
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
Remote Signer: Electra #14477
Conversation
blockElectraSignRequestsTotal = promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "remote_web3signer_block_electra_sign_requests_total", | ||
Help: "Total number of block electra sign requests", | ||
}) | ||
blindedBlockElectraSignRequestsTotal = promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "remote_web3signer_blinded_block_electra_sign_requests_total", | ||
Help: "Total number of blinded block electra sign requests", | ||
}) |
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 pattern seems bad. Why not just add a label to mention the fork?
blockSignRequestsTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "remote_web3signer_block_sign_requests_total",
Help: "Total number of block sign requests",
})
blindedBlockSignRequestsTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "remote_web3signer_blinded_block_sign_requests_total",
Help: "Total number of blinded block sign requests",
})
Then use it with appropriate value
blockSignRequestsTotal.WithLabelValues("fork", "electra").Inc()
I think we should do this for the v6 release. There is no reason to report old fork metrics by registering a counter for every fork when we could use labels. Can you add this for Electra, then we can make the breaking change for old metrics in v6?
func GetAggregateAndProofV2ElectraSignRequest(request *validatorpb.SignRequest, genesisValidatorsRoot []byte) (*AggregateAndProofV2ElectraSignRequest, error) { | ||
aggregateAttestationAndProof, ok := request.Object.(*validatorpb.SignRequest_AggregateAttestationAndProofElectra) | ||
if !ok { | ||
return nil, errors.New("failed to cast request object to aggregate attestation and proof") | ||
} | ||
if aggregateAttestationAndProof == nil { | ||
return nil, errors.New("invalid sign request: AggregateAndProof is nil") | ||
} | ||
fork, err := MapForkInfo(request.SigningSlot, genesisValidatorsRoot) | ||
if err != nil { | ||
return nil, err | ||
} | ||
aggregateAndProof, err := MapAggregateAndProofElectra(aggregateAttestationAndProof.AggregateAttestationAndProofElectra) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &AggregateAndProofV2ElectraSignRequest{ | ||
Type: "AGGREGATE_AND_PROOF_V2", | ||
ForkInfo: fork, | ||
SigningRoot: request.SigningRoot, | ||
AggregateAndProof: &AggregateAndProofV2Electra{ | ||
Version: "ELECTRA", | ||
Data: aggregateAndProof, | ||
}, | ||
}, nil | ||
} |
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 function is not covered by any test.
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.
oops forgot to add since it was waiting for sammy's pr
@@ -482,8 +488,20 @@ func handleAggregateAttestationAndProof(ctx context.Context, validator *validato | |||
return json.Marshal(aggregateAndProofSignRequest) | |||
} | |||
|
|||
func handleAggregateAttestationAndProofV2Electra(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.
Not covered by any test.
@@ -30,6 +27,11 @@ var ( | |||
Name: "remote_web3signer_attestation_sign_requests_total", | |||
Help: "Total number of attestation sign requests", | |||
}) | |||
//TODO: deprecate these fork specific counters in prysm v6... | |||
blockSignRequestsTotal = promauto.NewCounter(prometheus.CounterOpts{ |
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.
Should this one be included in the comment? blockSignRequestsTotal
is not fork specific right?
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.
it's phase 0 sign requests
@@ -482,8 +488,20 @@ func handleAggregateAttestationAndProof(ctx context.Context, validator *validato | |||
return json.Marshal(aggregateAndProofSignRequest) | |||
} | |||
|
|||
func handleAggregateAttestationAndProofV2Electra(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.
Is this meant to be V2 if it's Electra specific and is the only one?
func handleAggregateAttestationAndProofV2Electra(ctx context.Context, validator *validator.Validate, request *validatorpb.SignRequest, genesisValidatorsRoot []byte) ([]byte, error) { | |
func handleAggregateAttestationAndProofElectra(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.
or just be, as both seems odd
func handleAggregateAttestationAndProofV2Electra(ctx context.Context, validator *validator.Validate, request *validatorpb.SignRequest, genesisValidatorsRoot []byte) ([]byte, error) { | |
func handleAggregateAttestationAndProofV2(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.
hmm maybe i should just use V2
@@ -58,6 +60,13 @@ var ( | |||
Name: "remote_web3signer_blinded_block_deneb_sign_requests_total", | |||
Help: "Total number of blinded block deneb sign requests", | |||
}) | |||
///// |
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.
Meant to be here?
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.
yeah just to show that it's deprecated to there
@@ -88,6 +90,34 @@ func GetAggregateAndProofSignRequest(request *validatorpb.SignRequest, genesisVa | |||
}, nil | |||
} | |||
|
|||
// GetAggregateAndProofV2SignRequest maps the request for signing type AGGREGATE_AND_PROOF_V2 on Electra changes. | |||
func GetAggregateAndProofV2SignRequest(v int, request *validatorpb.SignRequest, genesisValidatorsRoot []byte) (*AggregateAndProofV2SignRequest, 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.
This function is not test covered.
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.
wait it is covered in TestKeymanager_Sign
What type of PR is this?
Feature
What does this PR do? Why is it needed?
updates the remote signing to handle changes from PRs ethereum/remote-signing-api#15 and ethereum/remote-signing-api#17
Kurtosis testing with the following settings
Which issues(s) does this PR fix?
Fixes #
Other notes for review
Acknowledgements