Skip to content

Enable Cubist Signer integration #3965

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

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open

Conversation

geoff-vball
Copy link
Contributor

Why this should be merged

The enables the rpc-signer configuration.

This is based off of this old PR.

How this works

I moved the instantiation of the signer from the config package to node.New() where we instantiate everything else that needs filesystem/networking. This way we don't need to propagate cleanup all over the place.

I also opted for a Shutdown() method on bls.Signer, which is how the other resources attached to node are managed. Currently, resources are not shutdown if we fail in another part of node.New(), but this is how the rest of the resources are also managed.

Out of scope for this PR, but we may want to consider some sort of registry of cleanup/shutdown functions that can be unwound whenever we fail.

How this was tested

Tests are still WIP

Need to be documented in RELEASES.md?

Yes?

richardpringle and others added 30 commits March 12, 2025 14:05
The code was changed without changing the behaviour. Instead of
`os.Stat`ing the file, we just try to read the file (which returned the
same error type).
Prior to this, we were checking if the file existed before attempting to
readd it. It was unnecessary and the logic has been removed.
Comment on lines +647 to +648
StakingTLSKeyPath: getExpandedArg(v, StakingTLSKeyPathKey),
StakingTLSCertPath: getExpandedArg(v, StakingCertPathKey),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed these to disambiguate from the bls signing items.

@geoff-vball geoff-vball marked this pull request as ready for review May 28, 2025 13:14
@StephenButtolph StephenButtolph requested review from a team and maru-ava and removed request for a team May 28, 2025 14:53
@geoff-vball geoff-vball changed the title Signers config wip Enable Cubist Signer integration May 28, 2025
Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Treating the signer the same way as the other Node composite fields makes sense to me. I left a few questions/comments about the config parsing pattern.


default:
return node.SignerPathConfig{
SigningKeyPath: getExpandedArg(v, StakingSignerKeyPathKey),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, if StakingSignerKeyPathKey is not set, do we use the default path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my understanding? But I'm not 100% how this expands to the default path - I just took the existing logic 😅

Comment on lines +73 to +75
if cfg.SignerPathIsSet {
return nil, errMissingStakingSigningKeyFile
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love this pattern of embedding metadata into the config struct that's only used for internal control flow. One alternative would be to return a signerPathIsSet bool from getStakingSignerConfig and pass that around, but dedicating an entire return parameter that needs to be managed by the caller for one specific configuration type is also cumbersome. I mainly wanted to call this out as a slightly awkward implementation, that may not have a cleaner alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't think passing a return parameter around is a good choice. Would renaming the boolean make more sense? I just kind of went off what was there, but I think "fromExistingFile" might make more sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a private field and a getter makes sense. I agree that I wouldn't add a return value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A private field in StakingConfig or in SignerPathConfig?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking in SignerPathConfig but I now realize that this is in node package instead of config which would require a constructor or a setter. I don't feel strongly about this either way but do prefer not serializing it (by omitting the json tag) if it's left public.

Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants