feat: proofClaim in Rollup - #8636
Conversation
update pruning logic.
| } | ||
|
|
||
| function _prune() internal { | ||
| delete proofClaim; |
There was a problem hiding this comment.
otherwise it will be there when we reorg
There was a problem hiding this comment.
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.
| @@ -44,23 +44,29 @@ library Errors { | |||
| error Outbox__BlockNotProven(uint256 l2BlockNumber); // 0x0e194a6d | |||
|
|
|||
| // Rollup | |||
There was a problem hiding this comment.
sorted alphabetically
LHerskind
left a comment
There was a problem hiding this comment.
Did not read through the full test, but here are some comments for now.
| 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.
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.
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.
| vkTreeRoot = _vkTreeRoot; | ||
| } | ||
|
|
||
| function claimEpochProofRight(DataStructures.EpochProofQuote calldata _quote) |
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
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.
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
canPrunelogic to account for it.