-
Notifications
You must be signed in to change notification settings - Fork 4
STR-1331 Optimistic Fulfiller Duties Execution #137
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
Conversation
b313d9e
to
29872d8
Compare
I've rebased this with |
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.
Beautifully organized PR. Content wise I have a lot to say, though. I'll leave the details to the individual comments. Any 🫡 emojis should be understood as explicit acks. This helps as we iterate on this PR to know what we've already looked at.
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.
minor nits and agree with Keagan's review
/// # CAUTION | ||
/// | ||
/// This should only be invoked for stake_index >= 1, i.e. from at least second stake | ||
/// transaction. |
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.
What if we added an idx
field to StakeTx
and then did an assert!
here (or even a debug_assert!
)?
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 could but I don't know if that is any better -- we'd have panics either way. The only difference will be when we invoke this function rather than when we broadcast the transaction, and both those things happen at about the same time.
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.
Cc @ProofOfKeags who might have a good argument here with enforcing invariants instead of warning about them in docstrings.
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.
That's the thing -- adding a runtime assertion does not enforce the invariant any more than the docstring.
The only way to really enforce it is to have separate types for the first and subsequent stake txs.
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, agreed. Maybe add a TODO then or a ticket?
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.
Okay, I'm cooking up 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.
Okay check this out: f3ffd2a.
I've completely overhauled the stake tx API so that it distinguishes between the first one and the rest. It'll be easier to review in the following order:
crates/stake-chain/src/transactions/stake_tx.rs
crates/stake-chain/src/stake_chain.rs
duty-tracker/src/contract_state_machine.rs
duty-tracker/src/contract-manager.rs
duty-tracker/src/executors/optimistic_withdrawal.rs
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 commit is amazing.
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.
ACK 6f45030
24cdf0a
to
244ccdf
Compare
…lment; refactor executors into separate module
2f05f4d
to
8e1deca
Compare
8e1deca
to
e0e3c9f
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.
ACK e0e3c9f
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.
ACK e0e3c9f
Description
This PR adds the ability for operator nodes to fulfill withdrawal requests and to get reimbursed provided that they are not challenged.
In so doing, it also makes the following additional changes:
strata
dependency to use the updated checkpoint/chain-state structure.bitvm
dependency to use the optimized graph generation.tx-graph
crate to not require connectors when finalizing.TODO
main
.Type of Change
Notes to Reviewers
Good luck. 👀
Checklist
Related Issues
Closes STR-1331