Skip to content
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

chore: Add cli option to specify withdrawer address in the add-l1-validator … #11199

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion yarn-project/cli/src/cmds/l1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
'test test test test test test test test test test test junk',
)
.addOption(l1ChainIdOption)
.option('--validator <addresse>', 'ethereum address of the validator', parseEthereumAddress)
.option('--validator <address>', 'ethereum address of the validator', parseEthereumAddress)
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
.option('--withdrawer <address>', 'ethereum address of the withdrawer', parseEthereumAddress)
.action(async options => {
const { addL1Validator } = await import('./update_l1_validators.js');
await addL1Validator({
Expand All @@ -89,6 +90,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
mnemonic: options.mnemonic,
validatorAddress: options.validator,
rollupAddress: options.rollup,
withdrawerAddress: options.withdrawer,
log,
debugLogger,
});
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/cli/src/cmds/l1/update_l1_validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface RollupCommandArgs {
privateKey?: string;
mnemonic?: string;
rollupAddress: EthAddress;
withdrawerAddress?: EthAddress;
}

export interface LoggerArgs {
Expand All @@ -37,6 +38,7 @@ export async function addL1Validator({
mnemonic,
validatorAddress,
rollupAddress,
withdrawerAddress,
log,
debugLogger,
}: RollupCommandArgs & LoggerArgs & { validatorAddress: EthAddress }) {
Expand Down Expand Up @@ -67,7 +69,7 @@ export async function addL1Validator({
const txHash = await rollup.write.deposit([
validatorAddress.toString(),
validatorAddress.toString(),
validatorAddress.toString(),
withdrawerAddress?.toString() ?? validatorAddress.toString(),
config.minimumStake,
]);
dualLog(`Transaction hash: ${txHash}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ else
# this may fail, so try 3 times
echo "Adding validator $ADDRESS..."
for i in {1..3}; do
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js add-l1-validator --validator $ADDRESS --rollup $ROLLUP_CONTRACT_ADDRESS && break
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js add-l1-validator --validator $ADDRESS --withdrawer $ADDRESS --rollup $ROLLUP_CONTRACT_ADDRESS && break
sleep 15
done
fi
Expand Down
Loading