Skip to content

Commit

Permalink
Fix cancels judgement mechanism (#169)
Browse files Browse the repository at this point in the history
fix cancel judgement
  • Loading branch information
mateuszaaa committed Jul 9, 2024
1 parent 1146078 commit 5b26e1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion contracts/src/Rolldown.sol
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ contract Rolldown is
CancelResolution memory resolution = CancelResolution({
requestId: RequestId({origin: Origin.L1, id: counter++}),
l2RequestId: cancel.requestId.id,
cancelJustified: correct_hash == cancel.hash,
cancelJustified: correct_hash != cancel.hash,
timeStamp: timeStamp
});

Expand Down
6 changes: 3 additions & 3 deletions contracts/test/rolldown.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract RolldownTest is Test, IRolldownPrimitives {
users = utils.createUsers(1);
rolldown = new Rolldown();
rolldown.initialize(avsPauserReg, avsOwner, ChainId.Ethereum, users[0]);
ETH_TOKEN_ADDRESS = payable(0x5748395867463837537395739375937493733457);
ETH_TOKEN_ADDRESS = payable(0x0000000000000000000000000000000000000001);
}

function beforeEach() public {}
Expand Down Expand Up @@ -413,7 +413,7 @@ contract RolldownTest is Test, IRolldownPrimitives {

vm.startPrank(alice);
vm.expectEmit(true, true, true, true);
emit IRolldownPrimitives.DisputeResolutionAcceptedIntoQueue(1, false);
emit IRolldownPrimitives.DisputeResolutionAcceptedIntoQueue(1, true);
rolldown.update_l1_from_l2(l2Update);
vm.stopPrank();
}
Expand Down Expand Up @@ -447,7 +447,7 @@ contract RolldownTest is Test, IRolldownPrimitives {

vm.startPrank(alice);
vm.expectEmit(true, true, true, true);
emit IRolldownPrimitives.DisputeResolutionAcceptedIntoQueue(1, true);
emit IRolldownPrimitives.DisputeResolutionAcceptedIntoQueue(1, false);
rolldown.update_l1_from_l2(l2Update);
vm.stopPrank();
}
Expand Down
16 changes: 1 addition & 15 deletions rollup-sequencer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ async function main() {
print(`is selected ${isSequencerSelected}`);
print(`rights : ${hasSequencerRights}`);
if (isSequencerSelected && hasSequencerRights) {
try {
if (inProgress) {
return;
}else{
Expand Down Expand Up @@ -77,20 +76,7 @@ async function main() {
} else {
print(`L1Update with max id == ${lastRequestId} was already submitted`);
}
} catch (e) {
if (e instanceof BaseError) {
print("Viem error occured - restarting service");
print(e);
throw e;
}else{
print("The contract function getUpdateForL2 returned no data");
print(e);
// Do nothing with error
// Error only appear when we have block where there are no data for getUpdateForL2 at all.
// This is only in the very beginning
// ContractFunctionExecutionError: The contract function "getUpdateForL2" returned no data ("0x").
}
}

inProgress = false;
}

Expand Down

0 comments on commit 5b26e1a

Please sign in to comment.