From ac1903e9cfe4a106047014d6d8862bee27878f2f Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Wed, 22 Jan 2025 13:00:50 -0500 Subject: [PATCH 01/10] feat: updates fee tracking and corid --- contracts/contracts/core/BidderRegistry.sol | 1 + contracts/contracts/core/PreconfManager.sol | 3 ++- contracts/contracts/core/ProviderRegistry.sol | 5 ++++- .../interfaces/IProviderRegistry.sol | 6 +++++- contracts/contracts/utils/FeePayout.sol | 9 +++++++++ contracts/lib/burners | 2 +- contracts/lib/core | 2 +- contracts/test/core/ProviderRegistryTest.sol | 20 +++++++++---------- 8 files changed, 33 insertions(+), 15 deletions(-) diff --git a/contracts/contracts/core/BidderRegistry.sol b/contracts/contracts/core/BidderRegistry.sol index a8125e522..171eeba99 100644 --- a/contracts/contracts/core/BidderRegistry.sol +++ b/contracts/contracts/core/BidderRegistry.sol @@ -179,6 +179,7 @@ contract BidderRegistry is uint256 amtMinusFeeAndDecay = decayedAmt - feeAmt; protocolFeeTracker.accumulatedAmount += feeAmt; + emit FeePayout.FundsAccumulatedForTreasury(commitmentDigest, feeAmt, protocolFeeTracker.recipient, bidState.bidder, provider); if (FeePayout.isPayoutDue(protocolFeeTracker)) { FeePayout.transferToRecipient(protocolFeeTracker); } diff --git a/contracts/contracts/core/PreconfManager.sol b/contracts/contracts/core/PreconfManager.sol index 3c48d18ba..354c383ef 100644 --- a/contracts/contracts/core/PreconfManager.sol +++ b/contracts/contracts/core/PreconfManager.sol @@ -426,7 +426,8 @@ contract PreconfManager is commitment.bidAmt, commitment.committer, payable(commitment.bidder), - residualBidPercentAfterDecay + residualBidPercentAfterDecay, + commitment.commitmentDigest ); bidderRegistry.unlockFunds(windowToSettle, commitment.commitmentDigest); diff --git a/contracts/contracts/core/ProviderRegistry.sol b/contracts/contracts/core/ProviderRegistry.sol index 8bd64a8c7..c211910d0 100644 --- a/contracts/contracts/core/ProviderRegistry.sol +++ b/contracts/contracts/core/ProviderRegistry.sol @@ -101,7 +101,8 @@ contract ProviderRegistry is uint256 amt, address provider, address payable bidder, - uint256 residualBidPercentAfterDecay + uint256 residualBidPercentAfterDecay, + bytes32 commitmentDigest ) external nonReentrant onlyPreconfManager whenNotPaused { uint256 residualAmt = (amt * residualBidPercentAfterDecay) / ONE_HUNDRED_PERCENT; uint256 penaltyFee = (residualAmt * feePercent) / ONE_HUNDRED_PERCENT; @@ -117,6 +118,7 @@ contract ProviderRegistry is providerStakes[provider] -= residualAmt + penaltyFee; penaltyFeeTracker.accumulatedAmount += penaltyFee; + emit FeePayout.FundsAccumulatedForTreasury(commitmentDigest, penaltyFee, penaltyFeeTracker.recipient, bidder, provider); if (FeePayout.isPayoutDue(penaltyFeeTracker)) { FeePayout.transferToRecipient(penaltyFeeTracker); } @@ -127,6 +129,7 @@ contract ProviderRegistry is } emit FundsSlashed(provider, residualAmt + penaltyFee); + emit FundsSlashedV2(provider, residualAmt + penaltyFee, commitmentDigest); } /** diff --git a/contracts/contracts/interfaces/IProviderRegistry.sol b/contracts/contracts/interfaces/IProviderRegistry.sol index e2804081a..78c2ef47a 100644 --- a/contracts/contracts/interfaces/IProviderRegistry.sol +++ b/contracts/contracts/interfaces/IProviderRegistry.sol @@ -12,6 +12,9 @@ interface IProviderRegistry { /// @dev Event emitted when funds are slashed event FundsSlashed(address indexed provider, uint256 amount); + /// @dev Event emitted when funds are slashed + event FundsSlashedV2(address indexed provider, uint256 amount, bytes32 indexed commitmentDigest); + /// @dev Event emitted when withdrawal is requested event Unstake(address indexed provider, uint256 timestamp); @@ -82,7 +85,8 @@ interface IProviderRegistry { uint256 amt, address provider, address payable bidder, - uint256 residualBidPercentAfterDecay + uint256 residualBidPercentAfterDecay, + bytes32 commitmentDigest ) external; function addVerifiedBLSKey(bytes calldata blsPublicKey, bytes calldata signature) external; diff --git a/contracts/contracts/utils/FeePayout.sol b/contracts/contracts/utils/FeePayout.sol index 7af7f1d2f..151718013 100644 --- a/contracts/contracts/utils/FeePayout.sol +++ b/contracts/contracts/utils/FeePayout.sol @@ -17,6 +17,15 @@ library FeePayout { /// @dev Event emitted when fees are transferred to the recipient. event FeeTransfer(uint256 amount, address indexed recipient); + /// @dev Event emitted when funds are accumulated for the treasury during commitment resolution + event FundsAccumulatedForTreasury( + bytes32 indexed commitmentDigest, + uint256 amount, + address recipient, + address indexed bidder, + address indexed provider + ); + error FeeRecipientIsZero(); error PayoutPeriodMustBePositive(); error TransferToRecipientFailed(); diff --git a/contracts/lib/burners b/contracts/lib/burners index c5840718d..60a5eb87f 160000 --- a/contracts/lib/burners +++ b/contracts/lib/burners @@ -1 +1 @@ -Subproject commit c5840718d3ebf79500b420e5f082e4f8a4363d48 +Subproject commit 60a5eb87f196b62d48406b45cc3b19ef4be0e906 diff --git a/contracts/lib/core b/contracts/lib/core index 106d10bcc..5061e30ba 160000 --- a/contracts/lib/core +++ b/contracts/lib/core @@ -1 +1 @@ -Subproject commit 106d10bcc77c9e1a1d2cd041f6840009ed135692 +Subproject commit 5061e30ba6866680d3a9a2b1a4c52f6cb95dc9fc diff --git a/contracts/test/core/ProviderRegistryTest.sol b/contracts/test/core/ProviderRegistryTest.sol index 19ce5a07c..0f04c20f4 100644 --- a/contracts/test/core/ProviderRegistryTest.sol +++ b/contracts/test/core/ProviderRegistryTest.sol @@ -258,7 +258,7 @@ contract ProviderRegistryTest is Test { address bidder = vm.addr(4); vm.expectCall(bidder, 1000000000000000000 wei, new bytes(0)); - providerRegistry.slash(1 ether, provider, payable(bidder), 1e18); + providerRegistry.slash(1 ether, provider, payable(bidder), 1e18, bytes32(0)); assertEq(bidder.balance, 1000000000000000000 wei); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 100000000000000000 wei); @@ -278,7 +278,7 @@ contract ProviderRegistryTest is Test { address bidder = vm.addr(4); vm.expectCall(bidder, 1000000000000000000 wei, new bytes(0)); - providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); + providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); assertEq(bidder.balance, 1000000000000000000 wei); assertEq(providerRegistry.providerStakes(provider), 0.9 ether); @@ -292,7 +292,7 @@ contract ProviderRegistryTest is Test { address bidder = vm.addr(4); vm.expectRevert(bytes("")); - providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); + providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); } function test_ShouldRetrieveFundsWhenSlashIsGreaterThanStake() public { vm.prank(address(this)); @@ -308,7 +308,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit InsufficientFundsToSlash(provider, 2 ether, 3 ether, 0.3 ether); - providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); + providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 0); assertEq(providerRegistry.providerStakes(provider), 0 ether); @@ -328,7 +328,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit InsufficientFundsToSlash(provider, 3 ether, 3 ether, 0.3 ether); - providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); + providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 0); assertEq(providerRegistry.providerStakes(provider), 0 ether); @@ -348,7 +348,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit InsufficientFundsToSlash(provider, 3.1 ether, 3 ether, 0.3 ether); - providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); + providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 0.1 ether); assertEq(providerRegistry.providerStakes(provider), 0 ether); @@ -364,7 +364,7 @@ contract ProviderRegistryTest is Test { providerRegistry.setPreconfManager(address(this)); - providerRegistry.slash(1e18 wei, provider, payable(bidder), 50 * providerRegistry.PRECISION()); + providerRegistry.slash(1e18 wei, provider, payable(bidder), 50 * providerRegistry.PRECISION(), bytes32(0)); assertEq( providerRegistry.getAccumulatedPenaltyFee(), 5e16 wei, @@ -382,7 +382,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit FeeTransfer(1e17 wei, vm.addr(6)); - providerRegistry.slash(1e18 wei, newProvider, payable(bidder), 50 * providerRegistry.PRECISION()); + providerRegistry.slash(1e18 wei, newProvider, payable(bidder), 50 * providerRegistry.PRECISION(), bytes32(0)); assertEq( providerRegistry.getAccumulatedPenaltyFee(), @@ -410,7 +410,7 @@ contract ProviderRegistryTest is Test { address(preconfManager) ); vm.prank(address(preconfManager)); - providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent); + providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent, bytes32(0)); vm.prank(newProvider); providerRegistry.unstake(); vm.warp(block.timestamp + 24 hours); // Move forward in time @@ -502,7 +502,7 @@ contract ProviderRegistryTest is Test { address(preconfManager) ); vm.prank(address(preconfManager)); - providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent); + providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent, bytes32(0)); vm.prank(newProvider); providerRegistry.unstake(); vm.warp(block.timestamp + 24 hours); // Move forward in time From 18bdcaecbe28fb18a4914776e3d0e7c402d52f36 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 12:50:00 -0500 Subject: [PATCH 02/10] chore: wip --- .github/workflows/ci.yml | 7 +++++-- contracts/lib/burners | 2 +- contracts/lib/core | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff9260a1f..f66570fde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,9 +157,12 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20.x - + - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + run: | + curl -L https://foundry.paradigm.xyz | bash + export PATH="$PATH:$HOME/.foundry/bin" + foundryup - name: Install solhint run: npm install -g solhint diff --git a/contracts/lib/burners b/contracts/lib/burners index 60a5eb87f..c5840718d 160000 --- a/contracts/lib/burners +++ b/contracts/lib/burners @@ -1 +1 @@ -Subproject commit 60a5eb87f196b62d48406b45cc3b19ef4be0e906 +Subproject commit c5840718d3ebf79500b420e5f082e4f8a4363d48 diff --git a/contracts/lib/core b/contracts/lib/core index 5061e30ba..106d10bcc 160000 --- a/contracts/lib/core +++ b/contracts/lib/core @@ -1 +1 @@ -Subproject commit 5061e30ba6866680d3a9a2b1a4c52f6cb95dc9fc +Subproject commit 106d10bcc77c9e1a1d2cd041f6840009ed135692 From c7419d648082dc06c9e9232dd004f5221789745e Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 12:51:59 -0500 Subject: [PATCH 03/10] chore: fix command --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f66570fde..764d95b93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,11 +157,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20.x - + - name: Install Foundry run: | curl -L https://foundry.paradigm.xyz | bash - export PATH="$PATH:$HOME/.foundry/bin" + source $HOME/.bashrc foundryup - name: Install solhint From 17cfaac8a48350717337cd94029ef63db87a1b0e Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 12:54:41 -0500 Subject: [PATCH 04/10] chore: revert everythign --- .github/workflows/ci.yml | 5 +---- contracts/contracts/core/BidderRegistry.sol | 1 - contracts/contracts/core/PreconfManager.sol | 3 +-- contracts/contracts/core/ProviderRegistry.sol | 5 +---- .../interfaces/IProviderRegistry.sol | 6 +----- contracts/contracts/utils/FeePayout.sol | 9 --------- contracts/test/core/ProviderRegistryTest.sol | 20 +++++++++---------- 7 files changed, 14 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 764d95b93..ff9260a1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,10 +159,7 @@ jobs: node-version: 20.x - name: Install Foundry - run: | - curl -L https://foundry.paradigm.xyz | bash - source $HOME/.bashrc - foundryup + uses: foundry-rs/foundry-toolchain@v1 - name: Install solhint run: npm install -g solhint diff --git a/contracts/contracts/core/BidderRegistry.sol b/contracts/contracts/core/BidderRegistry.sol index 171eeba99..a8125e522 100644 --- a/contracts/contracts/core/BidderRegistry.sol +++ b/contracts/contracts/core/BidderRegistry.sol @@ -179,7 +179,6 @@ contract BidderRegistry is uint256 amtMinusFeeAndDecay = decayedAmt - feeAmt; protocolFeeTracker.accumulatedAmount += feeAmt; - emit FeePayout.FundsAccumulatedForTreasury(commitmentDigest, feeAmt, protocolFeeTracker.recipient, bidState.bidder, provider); if (FeePayout.isPayoutDue(protocolFeeTracker)) { FeePayout.transferToRecipient(protocolFeeTracker); } diff --git a/contracts/contracts/core/PreconfManager.sol b/contracts/contracts/core/PreconfManager.sol index 354c383ef..3c48d18ba 100644 --- a/contracts/contracts/core/PreconfManager.sol +++ b/contracts/contracts/core/PreconfManager.sol @@ -426,8 +426,7 @@ contract PreconfManager is commitment.bidAmt, commitment.committer, payable(commitment.bidder), - residualBidPercentAfterDecay, - commitment.commitmentDigest + residualBidPercentAfterDecay ); bidderRegistry.unlockFunds(windowToSettle, commitment.commitmentDigest); diff --git a/contracts/contracts/core/ProviderRegistry.sol b/contracts/contracts/core/ProviderRegistry.sol index c211910d0..8bd64a8c7 100644 --- a/contracts/contracts/core/ProviderRegistry.sol +++ b/contracts/contracts/core/ProviderRegistry.sol @@ -101,8 +101,7 @@ contract ProviderRegistry is uint256 amt, address provider, address payable bidder, - uint256 residualBidPercentAfterDecay, - bytes32 commitmentDigest + uint256 residualBidPercentAfterDecay ) external nonReentrant onlyPreconfManager whenNotPaused { uint256 residualAmt = (amt * residualBidPercentAfterDecay) / ONE_HUNDRED_PERCENT; uint256 penaltyFee = (residualAmt * feePercent) / ONE_HUNDRED_PERCENT; @@ -118,7 +117,6 @@ contract ProviderRegistry is providerStakes[provider] -= residualAmt + penaltyFee; penaltyFeeTracker.accumulatedAmount += penaltyFee; - emit FeePayout.FundsAccumulatedForTreasury(commitmentDigest, penaltyFee, penaltyFeeTracker.recipient, bidder, provider); if (FeePayout.isPayoutDue(penaltyFeeTracker)) { FeePayout.transferToRecipient(penaltyFeeTracker); } @@ -129,7 +127,6 @@ contract ProviderRegistry is } emit FundsSlashed(provider, residualAmt + penaltyFee); - emit FundsSlashedV2(provider, residualAmt + penaltyFee, commitmentDigest); } /** diff --git a/contracts/contracts/interfaces/IProviderRegistry.sol b/contracts/contracts/interfaces/IProviderRegistry.sol index 78c2ef47a..e2804081a 100644 --- a/contracts/contracts/interfaces/IProviderRegistry.sol +++ b/contracts/contracts/interfaces/IProviderRegistry.sol @@ -12,9 +12,6 @@ interface IProviderRegistry { /// @dev Event emitted when funds are slashed event FundsSlashed(address indexed provider, uint256 amount); - /// @dev Event emitted when funds are slashed - event FundsSlashedV2(address indexed provider, uint256 amount, bytes32 indexed commitmentDigest); - /// @dev Event emitted when withdrawal is requested event Unstake(address indexed provider, uint256 timestamp); @@ -85,8 +82,7 @@ interface IProviderRegistry { uint256 amt, address provider, address payable bidder, - uint256 residualBidPercentAfterDecay, - bytes32 commitmentDigest + uint256 residualBidPercentAfterDecay ) external; function addVerifiedBLSKey(bytes calldata blsPublicKey, bytes calldata signature) external; diff --git a/contracts/contracts/utils/FeePayout.sol b/contracts/contracts/utils/FeePayout.sol index 151718013..7af7f1d2f 100644 --- a/contracts/contracts/utils/FeePayout.sol +++ b/contracts/contracts/utils/FeePayout.sol @@ -17,15 +17,6 @@ library FeePayout { /// @dev Event emitted when fees are transferred to the recipient. event FeeTransfer(uint256 amount, address indexed recipient); - /// @dev Event emitted when funds are accumulated for the treasury during commitment resolution - event FundsAccumulatedForTreasury( - bytes32 indexed commitmentDigest, - uint256 amount, - address recipient, - address indexed bidder, - address indexed provider - ); - error FeeRecipientIsZero(); error PayoutPeriodMustBePositive(); error TransferToRecipientFailed(); diff --git a/contracts/test/core/ProviderRegistryTest.sol b/contracts/test/core/ProviderRegistryTest.sol index 0f04c20f4..19ce5a07c 100644 --- a/contracts/test/core/ProviderRegistryTest.sol +++ b/contracts/test/core/ProviderRegistryTest.sol @@ -258,7 +258,7 @@ contract ProviderRegistryTest is Test { address bidder = vm.addr(4); vm.expectCall(bidder, 1000000000000000000 wei, new bytes(0)); - providerRegistry.slash(1 ether, provider, payable(bidder), 1e18, bytes32(0)); + providerRegistry.slash(1 ether, provider, payable(bidder), 1e18); assertEq(bidder.balance, 1000000000000000000 wei); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 100000000000000000 wei); @@ -278,7 +278,7 @@ contract ProviderRegistryTest is Test { address bidder = vm.addr(4); vm.expectCall(bidder, 1000000000000000000 wei, new bytes(0)); - providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); + providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); assertEq(bidder.balance, 1000000000000000000 wei); assertEq(providerRegistry.providerStakes(provider), 0.9 ether); @@ -292,7 +292,7 @@ contract ProviderRegistryTest is Test { address bidder = vm.addr(4); vm.expectRevert(bytes("")); - providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); + providerRegistry.slash(1 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); } function test_ShouldRetrieveFundsWhenSlashIsGreaterThanStake() public { vm.prank(address(this)); @@ -308,7 +308,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit InsufficientFundsToSlash(provider, 2 ether, 3 ether, 0.3 ether); - providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); + providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 0); assertEq(providerRegistry.providerStakes(provider), 0 ether); @@ -328,7 +328,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit InsufficientFundsToSlash(provider, 3 ether, 3 ether, 0.3 ether); - providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); + providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 0); assertEq(providerRegistry.providerStakes(provider), 0 ether); @@ -348,7 +348,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit InsufficientFundsToSlash(provider, 3.1 ether, 3 ether, 0.3 ether); - providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT(), bytes32(0)); + providerRegistry.slash(3 ether, provider, payable(bidder), providerRegistry.ONE_HUNDRED_PERCENT()); assertEq(providerRegistry.getAccumulatedPenaltyFee(), 0.1 ether); assertEq(providerRegistry.providerStakes(provider), 0 ether); @@ -364,7 +364,7 @@ contract ProviderRegistryTest is Test { providerRegistry.setPreconfManager(address(this)); - providerRegistry.slash(1e18 wei, provider, payable(bidder), 50 * providerRegistry.PRECISION(), bytes32(0)); + providerRegistry.slash(1e18 wei, provider, payable(bidder), 50 * providerRegistry.PRECISION()); assertEq( providerRegistry.getAccumulatedPenaltyFee(), 5e16 wei, @@ -382,7 +382,7 @@ contract ProviderRegistryTest is Test { vm.expectEmit(true, true, true, true); emit FeeTransfer(1e17 wei, vm.addr(6)); - providerRegistry.slash(1e18 wei, newProvider, payable(bidder), 50 * providerRegistry.PRECISION(), bytes32(0)); + providerRegistry.slash(1e18 wei, newProvider, payable(bidder), 50 * providerRegistry.PRECISION()); assertEq( providerRegistry.getAccumulatedPenaltyFee(), @@ -410,7 +410,7 @@ contract ProviderRegistryTest is Test { address(preconfManager) ); vm.prank(address(preconfManager)); - providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent, bytes32(0)); + providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent); vm.prank(newProvider); providerRegistry.unstake(); vm.warp(block.timestamp + 24 hours); // Move forward in time @@ -502,7 +502,7 @@ contract ProviderRegistryTest is Test { address(preconfManager) ); vm.prank(address(preconfManager)); - providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent, bytes32(0)); + providerRegistry.slash(1e18 wei, newProvider, payable(bidder), percent); vm.prank(newProvider); providerRegistry.unstake(); vm.warp(block.timestamp + 24 hours); // Move forward in time From 74422fe9e5feee0010fa7c67b277617cea5812eb Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 12:55:08 -0500 Subject: [PATCH 05/10] chore: bump version of toolchain --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff9260a1f..65e16f2f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,7 +159,7 @@ jobs: node-version: 20.x - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1.3.1 - name: Install solhint run: npm install -g solhint From 78e6fe362ec5333a0d0ad3b79bd3a8560f526548 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 15:10:05 -0500 Subject: [PATCH 06/10] chore: specify specific version --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65e16f2f1..b2a0bc070 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,6 +160,8 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1.3.1 + with: + version: v0.3.1 - name: Install solhint run: npm install -g solhint From bfe13a57e6eff488c8e47a0ba86dda366a507401 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 15:14:33 -0500 Subject: [PATCH 07/10] chore: manually install the package --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2a0bc070..526c22272 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,6 +157,9 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20.x + + - name: Install OpenZeppelin Upgrades Core + run: npm install @openzeppelin/upgrades-core@1.42.0 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1.3.1 From 9a8106640fccf50a54e765d385216b800b147cb3 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 15:15:55 -0500 Subject: [PATCH 08/10] chore: opt for nightly build --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 526c22272..2a4e1fc36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,14 +157,14 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20.x - + - name: Install OpenZeppelin Upgrades Core run: npm install @openzeppelin/upgrades-core@1.42.0 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1.3.1 with: - version: v0.3.1 + version: nightly - name: Install solhint run: npm install -g solhint From 4e16a537a20a6506fbaef8eff2428f91c1cea156 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 23 Jan 2025 15:22:23 -0500 Subject: [PATCH 09/10] chore: update all sections --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a4e1fc36..c1a4633ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,8 +123,13 @@ jobs: with: submodules: recursive + - name: Install OpenZeppelin Upgrades Core + run: npm install @openzeppelin/upgrades-core@1.42.0 + - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1.3.1 + with: + version: nightly - name: Print Versions run: | From 38cfb22db1f0d3e0469569fff9bac0be2cd6ee09 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Fri, 24 Jan 2025 11:53:00 -0500 Subject: [PATCH 10/10] chore: try new nightly build --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1a4633ca..1fb1c925c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,9 +127,9 @@ jobs: run: npm install @openzeppelin/upgrades-core@1.42.0 - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1.3.1 + uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: nightly-36d1a1ba7391957770638d2bbacd669adb5cfc00 - name: Print Versions run: | @@ -167,9 +167,9 @@ jobs: run: npm install @openzeppelin/upgrades-core@1.42.0 - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1.3.1 + uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: nightly-36d1a1ba7391957770638d2bbacd669adb5cfc00 - name: Install solhint run: npm install -g solhint