Skip to content

Comments

Remove GuardianModule contract#137

Merged
eladiosch merged 13 commits intoprotocol-redesignfrom
remove-guardian-module
Jan 20, 2026
Merged

Remove GuardianModule contract#137
eladiosch merged 13 commits intoprotocol-redesignfrom
remove-guardian-module

Conversation

@eladiosch
Copy link
Contributor

This PR removes the GuardianModule contract, related interfaces and contracts, and adapts the rest of contracts, scripts and tests.

The useful logic from the contract has been moved to PufferProtocol or the the Library LibSignatureVerifier

@eladiosch eladiosch requested a review from ksatyarth2 December 12, 2025 16:39
/**
* @notice Starts the validator
*/
function callStake(bytes calldata pubKey, bytes calldata signature, bytes32 depositDataRoot)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually we are not using the function anymore, but we could keep it in the code so avoid re-deploying this contract. We can simply not call it

Copy link
Contributor

@ksatyarth2 ksatyarth2 Jan 12, 2026

Choose a reason for hiding this comment

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

we can add @deprecated as natspec for this since we won't be calling it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done (@deprecated isn't a valid label for functions apparently, so used a @dev)

@ksatyarth2
Copy link
Contributor

how are we planning to store the EJECTION_THRESHOLD ? this is an important value from GuardianModule

*/
uint256 internal constant _BLS_PUB_KEY_LENGTH = 48;

function _validateBatchWithdrawals(
Copy link
Contributor

Choose a reason for hiding this comment

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

we are verifying/validating the paymaster signature here, but the provision node is missing that.
we shall do the similar validation of signature only for provision too, similar to what we have in GuardianModule.
or have an external function itself in this library that can be called by our off-chain service to validate the call before making actual call

Copy link
Contributor

Choose a reason for hiding this comment

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

same for skipProvisioning

Copy link
Contributor Author

@eladiosch eladiosch Jan 12, 2026

Choose a reason for hiding this comment

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

I thought about this. And actually, it cannot be the paymaster that's going to call these functions, it's a multisig, so we can't use a standard signature. Since we're going to execute the transactions manually and do manual verification locally, we can skip signature verification.

I will adapt the natspec to reflect that only the ROLE_ID_NODE_PROVISIONER can call these functions (not the paymaster)

/**
* @inheritdoc IValidatorTicket
*/
address payable public immutable override GUARDIAN_MODULE;
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be immutable! Since this can be EOA and in case SK is leaked, there would be no way to change it here if this is constant.
Let's add setter/getter for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@eladiosch
Copy link
Contributor Author

EJECTION_THRESHOLD

In the current deployment, this value is not read onchain anywhere, so I figured we could just store it offchain

@eladiosch eladiosch merged commit bc22921 into protocol-redesign Jan 20, 2026
2 of 3 checks passed
@ksatyarth2 ksatyarth2 deleted the remove-guardian-module branch January 20, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants