-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add support for deploying a mock light client contract #1322
Conversation
nomaxg
commented
Apr 11, 2024
- Contract deployment script now supports a mock light client contract that has less ZK machinery
- STAKE_TABLE_CAPACITY is now configurable (a lower capacity really speeds up integration tests/ demos).
// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// |
:)
@@ -439,24 +448,26 @@ mod tests { | |||
.map(|b| if b { F::from(1u64) } else { F::from(0u64) }) | |||
.collect::<Vec<_>>(); | |||
// good path | |||
let (circuit, public_inputs) = build::<_, _, _, _, _, ST_CAPACITY>( | |||
let (circuit, public_inputs) = build::<_, _, _, _, _>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let (circuit, public_inputs) = build::<_, _, _, _, _>( | |
let (circuit, public_inputs) = build( |
one benefit of removing that const generic is to remove all the generic type hint.
same comment applied to everywhere else where we still have dangling <_, _, ...>
@@ -119,6 +124,7 @@ processes: | |||
- ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_1 | |||
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1 | |||
- ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX=11 | |||
- ESPRESSO_SEQUENCER_STAKE_TABLE_CAPACITY=10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any way to define a global (to all sequencer docker) env var declaration, so that we can centrally manged,
in case we forget to update one of them in the future?
let light_client = LightClientMock::new( | ||
contracts | ||
.deploy_fn(Contract::LightClient, |contracts| { | ||
deploy_light_client_contract(l1.clone(), contracts).boxed() | ||
deploy_light_client_contract( | ||
l1.clone(), | ||
contracts, | ||
opt.use_mock_contract, | ||
) | ||
.boxed() | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, shouldn't you gate this using use_mock_contract: bool
?
this code seems to always use LightClientMock
in the main()
?
@@ -313,7 +342,7 @@ async fn deploy_light_client_contract<M: Middleware + 'static>( | |||
.context("error linking PlonkVerifier lib")?; | |||
bytecode | |||
.link_fully_qualified( | |||
"contracts/src/libraries/LightClientStateUpdateVK.sol:LightClientStateUpdateVK", | |||
"contracts/tests/mocks/LightClientStateUpdateVK.sol:LightClientStateUpdateVK", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, a bit confused why are we using /mocks/
inside deploy_production_()
function
don't worry about my comments above, there are some legacy complication of deploying LC and LCMock differently, since one of them is upgradable, the other is not. It's probably faster for me to work on it. I'm gonna address them in a follow-up PR, building on your foundation. |