-
Notifications
You must be signed in to change notification settings - Fork 69
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
[light-client-integration] support for light client state signature #879
Conversation
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.
Question: is it ok for a node to choose not to run the state signature API? In other words isn't it considered malicious behavior for a node not to respond to this query? I'm wondering if we should make the Http
option required and always run at least the state signature API.
This is worth discussing. IMHO |
…into cl/light-client
…into cl/light-client
Do we plan to write tests for this feature in another PR? |
sequencer/src/state_signature.rs
Outdated
let new_light_client_state = LightClientState::<BaseField> { | ||
view_number: leaf.get_view_number().get_u64() as usize, | ||
block_height: leaf.get_height() as usize, | ||
block_comm_root: BaseField::default(), |
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.
We should add a TODO here as well right?
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'm writing tests now. Dealing with more problems :( |
…into cl/light-client
…into cl/light-client
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 looks good, but are we going to change it to POST signatures to another service, rather than just providing a query API for signatures?
handle: SystemContextHandle<TYPES, I>, | ||
|
||
/// Index of this sequencer node | ||
#[allow(dead_code)] |
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.
Do we plan to use this for something?
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.
Not from my side, it was one of the returns in the previous init_node
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.
Huh. If we're not using it I guess it's fine to delete it. Not a big deal though
Yes we are. But I think it's better to keep this query API, maybe as a backup in the future. |
sequencer/src/context.rs
Outdated
@@ -25,13 +30,20 @@ pub struct SequencerContext<TYPES: NodeType, I: NodeImplementation<TYPES>> { | |||
state_signatures: Arc<RwLock<StateSignatureMemStorage>>, | |||
} | |||
|
|||
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> SequencerContext<TYPES, I> { | |||
impl<N: network::Type> Clone for SequencerContext<N> { |
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 assume this is implemented manually because the derived implementation requires N: Clone
? You can use Derivative
to get around this:
#[derive(Derivative)]
#[derivative(Clone(bound = ""))]
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.
Yes Derivative
works! ddd5882
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 good!
closes: #801
What does this PR do
LeafDecided
event happens, it triggers thelight_client_signature_hook
to generate a new state signatureSystemContextHandle
is now wrapped inSequencerContext
, where the later includes a light client state signature pool that contains the most recent 100 signatures