Skip to content

Commit 942264f

Browse files
LeilaWangPhilWindle
authored andcommitted
feat: allow custom proof submission target address (#24270)
This pr adds an optional prover-node config, `PROVER_NODE_PROOF_SUBMISSION_TARGET_ADDRESS`, that lets a prover send the `submitEpochRootProof` tx to a contract other than the rollup. Everything else is unchanged: all rollup state is still read from the real rollup, only the destination of the submit tx is redirected. When unset, it defaults to the rollup address, so existing provers are unaffected. Use case: A prover that wants to claim prover tips from oxide-styled withdrawal txs must register itself in the Pool contract as the first prover to submit a proof of a given length L. To do that, it deploys a wrapper contract that calls the Pool before (check proven length = L-T) and after (check proven length = L) calling `submitEpochRootProof` on the rollup, then points this config at the wrapper. Closes GK-752 (cherry picked from commit 1039d38)
1 parent c3cba2b commit 942264f

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,31 @@ describe('prover-node-publisher', () => {
204204
(rollup as any).address = rollupAddress;
205205
publisher = new ProverNodePublisher(config, { rollupContract: rollup, l1TxUtils: l1Utils });
206206

207+
await publisher.submitEpochProof(setupPublishData(65, 32, 33, 64));
208+
expect(l1Utils.sendAndMonitorTransaction).toHaveBeenCalledWith(expect.objectContaining({ to: rollupAddress }));
209+
});
210+
211+
it('redirects the submit tx to the configured proof submission target', async () => {
212+
(rollup as any).address = EthAddress.random().toString();
213+
const target = EthAddress.random();
214+
publisher = new ProverNodePublisher(config, {
215+
rollupContract: rollup,
216+
l1TxUtils: l1Utils,
217+
proofSubmissionTarget: target,
218+
});
219+
220+
await publisher.submitEpochProof(setupPublishData(65, 32, 33, 64));
221+
expect(l1Utils.sendAndMonitorTransaction).toHaveBeenCalledWith(
222+
expect.objectContaining({ to: target.toString() }),
223+
);
224+
});
225+
});
226+
227+
it('waits until the proven checkpoint reaches the checkpoint before the proof start', async () => {
228+
const checkpoints = Array.from({ length: 100 }, () => RootRollupPublicInputs.random());
229+
const fromCheckpoint = CheckpointNumber(33);
230+
const toCheckpoint = CheckpointNumber(64);
231+
207232
await publisher.submitEpochProof(setupPublishData(65, 32, 33, 64));
208233
expect(l1Utils.sendAndMonitorTransaction).toHaveBeenCalledWith(
209234
expect.objectContaining({ to: rollupAddress }),

0 commit comments

Comments
 (0)