Skip to content

Commit 9c5fd75

Browse files
committed
review changes
1 parent 4eeddf6 commit 9c5fd75

File tree

9 files changed

+27
-38
lines changed

9 files changed

+27
-38
lines changed

spartan/scripts/test_kind.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ fi
8686
free_ports=$(find_ports 4)
8787

8888
# Extract the free ports from the list
89-
pxe_port=$(echo $free_ports | awk '{print $1}')
90-
anvil_port=$(echo $free_ports | awk '{print $2}')
91-
metrics_port=$(echo $free_ports | awk '{print $3}')
92-
node_port=$(echo $free_ports | awk '{print $4}')
89+
forwarded_pxe_port=$(echo $free_ports | awk '{print $1}')
90+
forwarded_anvil_port=$(echo $free_ports | awk '{print $2}')
91+
forwarded_metrics_port=$(echo $free_ports | awk '{print $3}')
92+
forwarded_node_port=$(echo $free_ports | awk '{print $4}')
9393

9494
if [ "$install_metrics" = "true" ]; then
9595
grafana_password=$(kubectl get secrets -n metrics metrics-grafana -o jsonpath='{.data.admin-password}' | base64 --decode)
@@ -115,13 +115,13 @@ if [ "$use_docker" = "true" ]; then
115115
-e INSTANCE_NAME="spartan" \
116116
-e SPARTAN_DIR="/usr/src/spartan" \
117117
-e NAMESPACE="$namespace" \
118-
-e HOST_PXE_PORT=$pxe_port \
118+
-e HOST_PXE_PORT=$forwarded_pxe_port \
119119
-e CONTAINER_PXE_PORT=8081 \
120-
-e HOST_ETHEREUM_PORT=$anvil_port \
120+
-e HOST_ETHEREUM_PORT=$forwarded_anvil_port \
121121
-e CONTAINER_ETHEREUM_PORT=8545 \
122-
-e HOST_NODE_PORT=$node_port \
122+
-e HOST_NODE_PORT=$forwarded_node_port \
123123
-e CONTAINER_NODE_PORT=8080 \
124-
-e HOST_METRICS_PORT=$metrics_port \
124+
-e HOST_METRICS_PORT=$forwarded_metrics_port \
125125
-e CONTAINER_METRICS_PORT=80 \
126126
-e GRAFANA_PASSWORD=$grafana_password \
127127
-e DEBUG=${DEBUG:-""} \
@@ -139,13 +139,13 @@ else
139139
export INSTANCE_NAME="spartan"
140140
export SPARTAN_DIR="$(pwd)/.."
141141
export NAMESPACE="$namespace"
142-
export HOST_PXE_PORT="$pxe_port"
142+
export HOST_PXE_PORT="$forwarded_pxe_port"
143143
export CONTAINER_PXE_PORT="8081"
144-
export HOST_ETHEREUM_PORT="$anvil_port"
144+
export HOST_ETHEREUM_PORT="$forwarded_anvil_port"
145145
export CONTAINER_ETHEREUM_PORT="8545"
146-
export HOST_NODE_PORT="$node_port"
146+
export HOST_NODE_PORT="$forwarded_node_port"
147147
export CONTAINER_NODE_PORT="8080"
148-
export HOST_METRICS_PORT="$metrics_port"
148+
export HOST_METRICS_PORT="$forwarded_metrics_port"
149149
export CONTAINER_METRICS_PORT="80"
150150
export GRAFANA_PASSWORD="$grafana_password"
151151
export DEBUG="${DEBUG:-""}"

yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ describe('e2e_p2p_governance_proposer', () => {
191191
const proposal = await governance.read.getProposal([0n]);
192192

193193
const timeToActive = proposal.creation + proposal.config.votingDelay;
194-
t.logger.info(`Warpping to ${timeToActive + 1n}`);
194+
t.logger.info(`Warping to ${timeToActive + 1n}`);
195195
await t.ctx.cheatCodes.eth.warp(Number(timeToActive + 1n));
196-
t.logger.info(`Warpped to ${timeToActive + 1n}`);
196+
t.logger.info(`Warped to ${timeToActive + 1n}`);
197197
await waitL1Block();
198198

199199
t.logger.info(`Voting`);
@@ -202,9 +202,9 @@ describe('e2e_p2p_governance_proposer', () => {
202202
t.logger.info(`Voted`);
203203

204204
const timeToExecutable = timeToActive + proposal.config.votingDuration + proposal.config.executionDelay + 1n;
205-
t.logger.info(`Warpping to ${timeToExecutable}`);
205+
t.logger.info(`Warping to ${timeToExecutable}`);
206206
await t.ctx.cheatCodes.eth.warp(Number(timeToExecutable));
207-
t.logger.info(`Warpped to ${timeToExecutable}`);
207+
t.logger.info(`Warped to ${timeToExecutable}`);
208208
await waitL1Block();
209209

210210
t.logger.info(`Checking governance proposer`);

yarn-project/ethereum/src/contracts/forwarder.test.ts

-4
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ describe('Forwarder', () => {
3333

3434
let vkTreeRoot: Fr;
3535
let protocolContractTreeRoot: Fr;
36-
// let initialValidators: EthAddress[];
3736
let l2FeeJuiceAddress: AztecAddress;
3837
let walletClient: L1Clients['walletClient'];
3938
let publicClient: L1Clients['publicClient'];
4039
let forwarder: ForwarderContract;
4140
let l1TxUtils: L1TxUtils;
42-
// let rollupAddress: EthAddress;
4341
let govProposerAddress: EthAddress;
4442
let tokenAddress: EthAddress;
4543
let tokenContract: GetContractReturnType<typeof TestERC20Abi, PublicClient<HttpTransport, Chain>>;
@@ -49,7 +47,6 @@ describe('Forwarder', () => {
4947
privateKey = privateKeyToAccount('0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba');
5048
vkTreeRoot = Fr.random();
5149
protocolContractTreeRoot = Fr.random();
52-
// initialValidators = times(3, EthAddress.random);
5350
l2FeeJuiceAddress = await AztecAddress.random();
5451

5552
({ anvil, rpcUrl } = await startAnvil());
@@ -65,7 +62,6 @@ describe('Forwarder', () => {
6562
});
6663

6764
govProposerAddress = deployed.l1ContractAddresses.governanceProposerAddress;
68-
// rollupAddress = deployed.l1ContractAddresses.rollupAddress;
6965

7066
forwarder = await ForwarderContract.create(
7167
privateKey.address,

yarn-project/ethereum/src/contracts/forwarder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class ForwarderContract {
117117
address: this.rollupAddress,
118118
stateDiff: [
119119
{
120-
slot: toHex(RollupContract.checkBlobSlot, true),
120+
slot: toHex(RollupContract.checkBlobStorageSlot, true),
121121
value: toHex(0n, true),
122122
},
123123
],

yarn-project/ethereum/src/contracts/rollup.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export type EpochProofQuoteViemArgs = {
4545
export class RollupContract {
4646
private readonly rollup: GetContractReturnType<typeof RollupAbi, PublicClient<HttpTransport, Chain>>;
4747

48-
static get checkBlobSlot(): bigint {
48+
static get checkBlobStorageSlot(): bigint {
4949
const asString = RollupStorage.find(storage => storage.label === 'checkBlob')?.slot;
5050
if (asString === undefined) {
51-
throw new Error('checkBlobSlot not found');
51+
throw new Error('checkBlobStorageSlot not found');
5252
}
5353
return BigInt(asString);
5454
}

yarn-project/ethereum/src/l1_tx_utils.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -663,21 +663,15 @@ export class L1TxUtils {
663663
address: Hex;
664664
},
665665
blobInputs: (L1BlobInputs & { maxFeePerBlobGas: bigint }) | undefined,
666-
stateOverride: {
667-
address: `0x${string}`;
668-
stateDiff: {
669-
slot: `0x${string}`;
670-
value: `0x${string}`;
671-
}[];
672-
}[] = [],
666+
stateOverride: StateOverride = [],
673667
) {
674668
try {
675669
await this.publicClient.simulateContract({
676670
...args,
677671
account: this.walletClient.account,
678672
stateOverride,
679673
});
680-
this.logger?.info('Simulated blob tx', { blobInputs });
674+
this.logger?.trace('Simulated blob tx', { blobInputs });
681675
// If the above passes, we have a blob error. We cannot simulate blob txs, and failed txs no longer throw errors.
682676
// Strangely, the only way to throw the revert reason as an error and provide blobs is prepareTransactionRequest.
683677
// See: https://github.com/wevm/viem/issues/2075
@@ -696,9 +690,9 @@ export class L1TxUtils {
696690
to: args.address,
697691
data,
698692
};
699-
this.logger?.info('Preparing tx', { request });
693+
this.logger?.trace('Preparing tx', { request });
700694
await this.walletClient.prepareTransactionRequest(request);
701-
this.logger?.info('Prepared tx');
695+
this.logger?.trace('Prepared tx');
702696
return undefined;
703697
} catch (simulationErr: any) {
704698
// If we don't have a ContractFunctionExecutionError, we have a blob related error => use getContractError to get the error msg.

yarn-project/prover-node/src/prover-node-publisher.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ export class ProverNodePublisher {
237237
abi: RollupAbi,
238238
address: this.rollupContract.address,
239239
},
240-
undefined,
241-
[],
240+
/*blobInputs*/ undefined,
241+
/*stateOverride*/ [],
242242
);
243243
this.log.error(`Rollup submit epoch proof tx reverted. ${errorMsg}`);
244244
return undefined;

yarn-project/sequencer-client/src/publisher/sequencer-publisher.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { SequencerPublisher, VoteType } from './sequencer-publisher.js';
2929

3030
const mockRollupAddress = EthAddress.random().toString();
3131
const mockGovernanceProposerAddress = EthAddress.random().toString();
32-
// const mockSlashingProposerAddress = EthAddress.random().toString();
3332
const mockForwarderAddress = EthAddress.random().toString();
3433
const BLOB_SINK_PORT = 50525;
3534
const BLOB_SINK_URL = `http://localhost:${BLOB_SINK_PORT}`;

yarn-project/sequencer-client/src/publisher/sequencer-publisher.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ export class SequencerPublisher {
403403
}
404404
return { payload: slashPayload, base: this.slashingProposerContract };
405405
}
406-
throw new Error('Invalid vote type');
406+
throw new Error('Unreachable: Invalid vote type');
407407
}
408408

409409
/**
@@ -606,7 +606,7 @@ export class SequencerPublisher {
606606
// @note we override checkBlob to false since blobs are not part simulate()
607607
stateDiff: [
608608
{
609-
slot: toHex(RollupContract.checkBlobSlot, true),
609+
slot: toHex(RollupContract.checkBlobStorageSlot, true),
610610
value: toHex(0n, true),
611611
},
612612
],

0 commit comments

Comments
 (0)