Skip to content

Commit

Permalink
update excess fee inhibitor to 16384
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed Sep 24, 2024
1 parent 982a735 commit bc9a827
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 16384 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 16384
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 16384

#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 16384 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 16384
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 16384

#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(16384)));
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(16383)));
vm.prank(sysaddr);
(ret, data) = addr.call("");
assertStorage(excess_slot, 1180-target_per_block, "didn't expect excess to be reset");
assertStorage(excess_slot, 16383-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, 16384, 17), 550585409188229536592656984201962691914788118703985791268517117099222302069);
}
}
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(16384)));
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(16383)));
vm.prank(sysaddr);
(ret, data) = addr.call("");
assertStorage(excess_slot, 1180-target_per_block, "didn't expect excess to be reset");
assertStorage(excess_slot, 16383-target_per_block, "didn't expect excess to be reset");
}

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

0 comments on commit bc9a827

Please sign in to comment.