Skip to content

Commit

Permalink
update excess fee inhibitor to 65536
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed Sep 26, 2024
1 parent 75e602a commit 5128fcb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/consolidations/ctor.eas
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;; Store 1181 as a temporary excess value as it creates a fee so large that no
;; Store 65536 as a temporary excess value as it creates a fee so large that no
;; request will be accepted in the queue until after 7002 is activated and
;; called by the system for the first time.
push 1181
push 65536
push0
sstore

Expand Down
2 changes: 1 addition & 1 deletion src/consolidations/main.eas
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define TARGET_PER_BLOCK 1
#define MAX_PER_BLOCK 1
#define FEE_UPDATE_FRACTION 17
#define EXCESS_INHIBITOR 1181
#define EXCESS_INHIBITOR 65536

#define INPUT_SIZE 96 ;; the size of (source ++ target)
#define RECORD_SIZE 116 ;; the size of (address ++ source ++ target)
Expand Down
4 changes: 2 additions & 2 deletions src/withdrawals/ctor.eas
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;; Store 1181 as a temporary excess value as it creates a fee so large that no
;; Store 65536 as a temporary excess value as it creates a fee so large that no
;; request will be accepted in the queue until after 7002 is activated and
;; called by the system for the first time.
push 1181
push 65536
push0
sstore

Expand Down
2 changes: 1 addition & 1 deletion src/withdrawals/main.eas
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define TARGET_PER_BLOCK 2
#define MAX_PER_BLOCK 16
#define FEE_UPDATE_FRACTION 17
#define EXCESS_INHIBITOR 1181
#define EXCESS_INHIBITOR 65536

#define INPUT_SIZE 56 ;; the size of (pubkey ++ amount)
#define RECORD_SIZE 76 ;; the size of (address ++ pubkey ++ amount)
Expand Down
6 changes: 3 additions & 3 deletions test/Consolidation.t.sol.in
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ contract ConsolidationTest is Test {
// testInhibitorRest verifies that after the first system call the excess
// value is reset to 0.
function testInhibitorReset() public {
vm.store(addr, bytes32(0), bytes32(uint256(1181)));
vm.store(addr, bytes32(0), bytes32(uint256(65536)));
vm.prank(sysaddr);
(bool ret, bytes memory data) = addr.call("");
assertStorage(excess_slot, 0, "expected excess requests to be reset");

vm.store(addr, bytes32(0), bytes32(uint256(1180)));
vm.store(addr, bytes32(0), bytes32(uint256(65535)));
vm.prank(sysaddr);
(ret, data) = addr.call("");
assertStorage(excess_slot, 1180-target_per_block, "didn't expect excess to be reset");
assertStorage(excess_slot, 65535-target_per_block, "didn't expect excess to be reset");
}

// --------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions test/FakeExpo.t.sol.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ contract FakeExpoTest is Test {
// testFakeExpo calls the fake exponentiation logic with specific values.
function testFakeExpo() public {
assertEq(callFakeExpo(1, 100, 17), 357);
assertEq(callFakeExpo(1, 65536, 17), 923226766505217739920341538189009691485399699651503388307248448916147782597);
}
}
6 changes: 3 additions & 3 deletions test/Withdrawal.t.sol.in
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ contract WithdrawalsTest is Test {
// testInhibitorRest verifies that after the first system call the excess
// value is reset to 0.
function testInhibitorReset() public {
vm.store(addr, bytes32(0), bytes32(uint256(1181)));
vm.store(addr, bytes32(0), bytes32(uint256(65536)));
vm.prank(sysaddr);
(bool ret, bytes memory data) = addr.call("");
assertStorage(excess_slot, 0, "expected excess requests to be reset");

vm.store(addr, bytes32(0), bytes32(uint256(1180)));
vm.store(addr, bytes32(0), bytes32(uint256(65535)));
vm.prank(sysaddr);
(ret, data) = addr.call("");
assertStorage(excess_slot, 1180-target_per_block, "didn't expect excess to be reset");
assertStorage(excess_slot, 65535-target_per_block, "didn't expect excess to be reset");
}

// --------------------------------------------------------------------------
Expand Down

0 comments on commit 5128fcb

Please sign in to comment.