-
Notifications
You must be signed in to change notification settings - Fork 81
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
refactor: static stake table simplication, simpler LightClientState #1939
refactor: static stake table simplication, simpler LightClientState #1939
Conversation
…enesis-state-struct-and-remove-states-mapping
…enesis-state-struct-and-remove-states-mapping
Initial attempt to fix compilation errors.
Made some progress fixing the compilation errors but not there yet:
Right now, for some reason the espresso-types crates does not compile. |
…branch, lc-contract-updates and ensure that all references to the StakeState compiles
the branch,
|
…he process of updating the related adapte and hotshot-state-prover code e.g. the MockGenesis action
3a27dda |
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.
I've looked at adapter/*
, diff-test
, hotshot-state-prover
they all look very good to me. Alysia is doing great work. 👏 (chore, but she does them with precision)
I have addressed all of my own comments in #1986
contracts/rust/diff-test/src/main.rs
Outdated
schnorr_key_comm: field_to_u256(stt.stake_table_schnorr_key_comm), | ||
amount_comm: field_to_u256(stt.stake_table_amount_comm), | ||
}; | ||
stake_stakes.push(parsed_stake_state.into()); |
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.
Looks like stake_stakes
vector is not returned. Why is that?
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.
this will be removed in my future commit of mine
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.
removed in af51261
…ude the new stake state struct, not all tests pass and the proofs need to be assessed more carefully
…lient-contract-create-genesis-state-struct-and-remove-states-mapping
circuit.create_public_variable(state.fee_ledger_comm)?, | ||
circuit.create_public_variable(state.stake_table_comm.0)?, | ||
circuit.create_public_variable(state.stake_table_comm.1)?, | ||
circuit.create_public_variable(state.stake_table_comm.2)?, |
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.
ah this is wrong actually. 🤦
(i missed it yesterday when I reviewed it, and wasted some time today assuming our Public input is reduced to 4)
we should still keep the stake table commitments in the public inputs for security/integrity!!
but we can safely remove fee_ledger_comm
, so PI.length is 7 now.
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.
ah, I need to fix HotShot
side as well for the struct declaration.
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.
fixed in ab81b0b
hotshot-state-prover/src/circuit.rs
Outdated
let stake_amount_comm = RescueNativeGadget::<F>::rescue_sponge_with_padding( | ||
let _stake_amount_comm = RescueNativeGadget::<F>::rescue_sponge_with_padding( | ||
&mut circuit, | ||
&stake_amount_preimage_vars, | ||
1, | ||
)?[0]; | ||
circuit.enforce_equal( | ||
stake_amount_comm, | ||
lightclient_state_pub_var | ||
.stake_table_comm() | ||
.stake_amount_comm, | ||
)?; |
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.
realized that these are wrong, we need these to ensure security.
sry that I miss it during my last review.
(p.s. I'm fixing these locally, will push soon)
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.
fixed in ab81b0b
…e-struct-and-remove-states-mapping' into 1938-update-state-prover
* update PublicInput length from 8 to 4 * Revert "update PublicInput length from 8 to 4" This reverts commit 40e2c67. * update PublicInput length from 8 to 7. --------- Co-authored-by: Philippe Camacho <[email protected]>
…enesis-state-struct-and-remove-states-mapping
…nt-contract-create-genesis-state-struct-and-remove-states-mapping
Another attempt to update hotshot version to `rc-0.5.74`, aims to supercede #1988
In EspressoSystems/espresso-sequencer#1939 the light client ABI changed and as a result we need to make changes in multiple places. The tracking issue for the changes in our nitro integration is https://github.com/EspressoSystems/nitro-contracts/issues/20
* CI: print docker logs on failure * Pin version before LC ABI changes In EspressoSystems/espresso-sequencer#1939 the light client ABI changed and as a result we need to make changes in multiple places. The tracking issue for the changes in our nitro integration is https://github.com/EspressoSystems/nitro-contracts/issues/20 * Pin the espresso-dev-node image
… finalized state
Closes #1938
This PR:
LightClientState
and adds a new structStakeState
This PR does not:
Key places to review: