-
Notifications
You must be signed in to change notification settings - Fork 256
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: proofClaim in Rollup #8636
feat: proofClaim in Rollup #8636
Conversation
update pruning logic.
function _prune() internal { | ||
delete proofClaim; |
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.
otherwise it will be there when we reorg
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.
When reached in a call to prune
(outside of proposals) this will incur higher cost than something like the approach we discussed with the forced inclusion. Here it is fix size, and should overall make it slightly cheaper when happening in the intended flow, e.g., as part of proposing.
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.
@@ -44,23 +44,29 @@ library Errors { | |||
error Outbox__BlockNotProven(uint256 l2BlockNumber); // 0x0e194a6d | |||
|
|||
// Rollup |
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.
sorted alphabetically
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.
Did not read through the full test, but here are some comments for now.
@@ -53,6 +53,9 @@ contract Rollup is Leonidas, IRollup, ITestRollup { | |||
// @todo #8018 | |||
uint256 public constant TIMELINESS_PROVING_IN_SLOTS = 100; | |||
|
|||
uint256 public constant CLAIM_DURATION_IN_L2_SLOTS = 13; | |||
uint256 public constant PROOF_COMMITMENT_MIN_BOND_AMOUNT_IN_TST = 1000; |
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.
For the sake of sanity we should probably shove this into a constants file, since we will likely be needing it in the node as well, so having it in one place should help us a bit there.
function _prune() internal { | ||
delete proofClaim; |
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.
When reached in a call to prune
(outside of proposals) this will incur higher cost than something like the approach we discussed with the forced inclusion. Here it is fix size, and should overall make it slightly cheaper when happening in the intended flow, e.g., as part of proposing.
@@ -156,6 +160,59 @@ contract Rollup is Leonidas, IRollup, ITestRollup { | |||
vkTreeRoot = _vkTreeRoot; | |||
} | |||
|
|||
function claimEpochProofRight(DataStructures.EpochProofQuote calldata _quote) |
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 not sure I like the claim name, mainly as claiming usually is claiming rewards or the like, but here your claim is practically "reducing" your balance because of the stake.
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 it's a tricky thing to name, since the proposer is the one doing it, but the provers bond is the one getting staked. Open to suggestions.
address currentProposer = getCurrentProposer(); | ||
uint256 epochToProve = getEpochToProve(); | ||
|
||
if (currentProposer != address(0) && currentProposer != msg.sender) { |
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.
If currentProposer == address(0)
you don't have a committee, does it become weird with epochs then? At that point issue is essentially that sure you can have an epoch, but as anyone could propose into it, it seems likely that you would not end up being able to rely on it, so seems more likely that it would be the "proposeAndProof" at the same time similar to the fallback. Might just be the sanest to be in fallback if there is no committee actually.
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.
Might just be the sanest to be in fallback if there is no committee actually.
I think I agree with this. We'll see how this needs to change in response when based fallback lands.
} | ||
|
||
if (currentSlot % Constants.AZTEC_EPOCH_DURATION >= CLAIM_DURATION_IN_L2_SLOTS) { | ||
revert Errors.Rollup__NotInClaimPhase( |
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 think a more useful error message would likely be:
error Rollup__NotInClaimPhase(uint256 slotInEpoch, uint256 claimSlotsInEpoch);
Reasoning being that you then get information that is more useful for debugging without needing the figure out what the constant is. This way if you get 13, 13 you know instantly that it was sent too late and you know it must be within the first 13 slots so you were 1 off.
@@ -53,6 +53,9 @@ contract Rollup is Leonidas, IRollup, ITestRollup { | |||
// @todo #8018 | |||
uint256 public constant TIMELINESS_PROVING_IN_SLOTS = 100; |
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 one is kinda redundant with your stuff just below 🤷
revert Errors.Rollup__QuoteExpired(currentSlot, _quote.validUntilSlot); | ||
} | ||
|
||
address bondProvider = PROOF_COMMITMENT_ESCROW.stakeBond(_quote); |
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 stake, but there won't ever be an unstake. Bye bye money. See comment in other pr.
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 was waiting to unstake the bond until the proof of epoch landed.
I filed #8652.
Fix #8608 Add the proofClaim to the rollup. Update the `canPrune` logic to account for it.
Fix #8608 Add the proofClaim to the rollup. Update the `canPrune` logic to account for it.
Fix #8608
Add the proofClaim to the rollup.
Update the
canPrune
logic to account for it.