-
Notifications
You must be signed in to change notification settings - Fork 63
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(offchain): adds the authority-claimer #45
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.
I see we're not reading the state of the blockchain to send claims. Are you absolutely sure we don't need it anymore?
async fn start( | ||
&'a self, | ||
broker_listener: L, | ||
claim_sender: S, | ||
) -> Result<(), AuthorityClaimerError<S, L>> { |
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 construction is curious to me, what's the self
for? Couldn't this be just a normal function, and the type parameter be part of the function? Or Rust's impl
feature (e.g. broker_listener: impl BrokerListener
)?
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.
You are a lifesaver, I fought for days with Rust and hated this solution.
I just needed to change stuff to the function...
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.
Hahaha, no problem! But don't forget the top review comment on not reading the state of the blockchain anymore. That's the most important.
29c440a
to
f09af56
Compare
Not absolutely. |
Are the blockchain and the broker listener certainly in sync? Is there any chance the authority may send duplicated claims? |
f09af56
to
ef02d55
Compare
That is what I'm going to start to think long and hard about. Hehe. It may be we need to read from the blockchain for certainty. |
Yeah, I think we'll need to haha. What happens if the node or redis crashes, or get ejected, or whatever? |
I agree with @GCdePaula. The claimer should read from the blockchain which claims were already sent. |
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.
The code looks great. The main thing missing is the trait to get whether the claim is already in the blockchain.
1209758
to
be50d3f
Compare
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 is looking pretty good! Just minor comments.
be50d3f
to
10398cb
Compare
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 awesome!
10398cb
to
87e5284
Compare
87e5284
to
9eaec68
Compare
This is mostly code imported from the dispatcher.
Had to do some code massaging to fit Rust's restrictions when using traits.