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

feat: proposer forwarder contract #11403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

just-mitch
Copy link
Collaborator

@just-mitch just-mitch commented Jan 21, 2025

See the design.

TLDR:

  • make a forwarder contract that dispatches to the various things a sequencer does (publish a block, vote, claim a quote, etc)
  • refactor the L1 publisher into a classes dedicated for the prover node, and for the sequencer.

Future work:

@just-mitch just-mitch linked an issue Jan 21, 2025 that may be closed by this pull request
@just-mitch just-mitch changed the title 11103 featsequencerl1 proposer forwarder contract feat: proposer forwarder contract Jan 23, 2025
@just-mitch just-mitch marked this pull request as ready for review January 23, 2025 19:29
@just-mitch just-mitch force-pushed the 11103-featsequencerl1-proposer-forwarder-contract branch 6 times, most recently from c3f76cd to 339bc31 Compare January 27, 2025 20:41
@just-mitch just-mitch added the e2e-all CI: Enables this CI job. label Jan 27, 2025
@just-mitch just-mitch force-pushed the 11103-featsequencerl1-proposer-forwarder-contract branch 3 times, most recently from 23256d2 to f72faad Compare January 28, 2025 18:37
@@ -190,7 +200,13 @@ export interface DeployL1ContractsArgs extends L1ContractsConfig {

export type L1Clients = {
publicClient: PublicClient<HttpTransport, Chain>;
walletClient: WalletClient<HttpTransport, Chain, Account>;
walletClient: Client<
Copy link
Member

Choose a reason for hiding this comment

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

curious as to why this had to change from the WalletClient type

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is to merge in the public actions with the wallet client.

});

if (rollupFunctionName === 'propose') {
rollupData = callData;
Copy link
Member

Choose a reason for hiding this comment

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

i feel like we can just return immediately here. and skip reducing the rollup calls

@@ -60,6 +63,23 @@ export class AnvilTestWatcher {
await this.filledRunningPromise?.stop();
}

async mineIfOutdated() {
Copy link
Member

Choose a reason for hiding this comment

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

this must have been a pain

const forwarderContract =
config.customForwarderContractAddress && config.customForwarderContractAddress !== EthAddress.ZERO
? new ForwarderContract(publicClient, config.customForwarderContractAddress.toString())
: await ForwarderContract.create(walletClient.account.address, walletClient, publicClient, log);
Copy link
Member

Choose a reason for hiding this comment

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

when moving to live networks we should probably add a command to our CLI that does this initialisation, we dont want to have people accidentally keep deploying these over config errors

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call. I filed 11603

Copy link
Member

@Maddiaa0 Maddiaa0 left a comment

Choose a reason for hiding this comment

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

minor comments, huge effort well done

@just-mitch just-mitch force-pushed the 11103-featsequencerl1-proposer-forwarder-contract branch from ccb3aa2 to a367bd3 Compare January 29, 2025 01:01
@just-mitch just-mitch force-pushed the 11103-featsequencerl1-proposer-forwarder-contract branch from 00da5ff to b52ffd1 Compare January 29, 2025 19:32
@just-mitch just-mitch added the network-all Run this CI job. label Jan 30, 2025
};
}

public async tryGetErrorFromRevertedTx(
Copy link
Member

Choose a reason for hiding this comment

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

some of this is covered in formatViemError function.
It's a bit of a mess and I wanted to spend some time to get it actually right, wonder if it'd be worth me doing on top of this PR (as a separate one)

Copy link
Member

Choose a reason for hiding this comment

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

I saw that you wanted to merge this today so feel free to ignore, will work on it once merged

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah agreed. The formatViemError function came into being after I had done the initial refactoring, so as you mentioned, this is a semi-stale artifact.

Definitely it is worth investing in error handling after this PR goes in.

@just-mitch just-mitch force-pushed the 11103-featsequencerl1-proposer-forwarder-contract branch 2 times, most recently from 06f6a0e to 58263b4 Compare January 30, 2025 15:08
@just-mitch just-mitch removed e2e-all CI: Enables this CI job. network-all Run this CI job. labels Jan 30, 2025
@just-mitch just-mitch force-pushed the 11103-featsequencerl1-proposer-forwarder-contract branch from 58263b4 to f0f7be0 Compare January 30, 2025 15:49
Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

refactor: different publishers for sequencer and prover
feat: sequencer publisher uses forwarder contract
@just-mitch just-mitch force-pushed the 11103-featsequencerl1-proposer-forwarder-contract branch from f0f7be0 to 02060aa Compare January 30, 2025 17:00
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.

feat(sequencer,L1): proposer forwarder contract
3 participants