From 2c2ab85a68c67011da236797b68548c5868439e2 Mon Sep 17 00:00:00 2001 From: arthcp Date: Fri, 21 Feb 2025 14:17:39 +0400 Subject: [PATCH 01/11] feat: robustness tests --- foundry.toml | 1 + script/robust/deployEVMx.sol | 31 ++++++ script/robust/deployPlugs.sol | 27 +++++ script/robust/deposit.sol | 27 +++++ script/robust/triggerseq.sol | 26 +++++ src/robust/RobAG.sol | 189 ++++++++++++++++++++++++++++++++++ src/robust/RobDep.sol | 28 +++++ src/robust/RobPlug.sol | 39 +++++++ 8 files changed, 368 insertions(+) create mode 100644 script/robust/deployEVMx.sol create mode 100644 script/robust/deployPlugs.sol create mode 100644 script/robust/deposit.sol create mode 100644 script/robust/triggerseq.sol create mode 100644 src/robust/RobAG.sol create mode 100644 src/robust/RobDep.sol create mode 100644 src/robust/RobPlug.sol diff --git a/foundry.toml b/foundry.toml index 25b918f..42f5584 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,5 +2,6 @@ src = "src" out = "out" libs = ["lib"] +evm_version = "paris" # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/script/robust/deployEVMx.sol b/script/robust/deployEVMx.sol new file mode 100644 index 0000000..c440324 --- /dev/null +++ b/script/robust/deployEVMx.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {RobDep} from "../../src/robust/RobDep.sol"; +import {RobAG} from "../../src/robust/RobAG.sol"; +import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; +import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; + +contract CounterDeploy is Script { + function run() external { + address addressResolver = vm.envAddress("ADDRESS_RESOLVER"); + address auctionManager = vm.envAddress("AUCTION_MANAGER"); + string memory rpc = vm.envString("OFF_CHAIN_VM_RPC"); + vm.createSelectFork(rpc); + + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + Fees memory fees = Fees({feePoolChain: 421614, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); + + RobDep deployer = new RobDep(addressResolver, auctionManager, FAST, fees); + + RobAG gateway = new RobAG(addressResolver, address(deployer), auctionManager, fees); + + console.log("Contracts deployed:"); + console.log("RobDep:", address(deployer)); + console.log("RobAG:", address(gateway)); + } +} diff --git a/script/robust/deployPlugs.sol b/script/robust/deployPlugs.sol new file mode 100644 index 0000000..dfb86a0 --- /dev/null +++ b/script/robust/deployPlugs.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {RobDep} from "../../src/robust/RobDep.sol"; +import {RobAG} from "../../src/robust/RobAG.sol"; +import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; +import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; + +contract CounterDeploy is Script { + function run() external { + string memory rpc = vm.envString("OFF_CHAIN_VM_RPC"); + vm.createSelectFork(rpc); + + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + // Fees memory fees = Fees({feePoolChain: 421614, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); + + RobDep deployer = RobDep(vm.envAddress("APP_DEPLOYER")); + deployer.deployContracts(11155420); + deployer.deployContracts(421614); + + console.log("Contracts deployed:"); + } +} diff --git a/script/robust/deposit.sol b/script/robust/deposit.sol new file mode 100644 index 0000000..3f51d03 --- /dev/null +++ b/script/robust/deposit.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {FeesPlug} from "socket-protocol/contracts/protocol/payload-delivery/FeesPlug.sol"; +import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; +import {ETH_ADDRESS} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; + +contract DepositFees is Script { + function run() external { + vm.createSelectFork(vm.envString("ARBITRUM_SEPOLIA_RPC")); + + uint256 privateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(privateKey); + FeesPlug feesPlug = FeesPlug(payable(vm.envAddress("ARBITRUM_FEES_PLUG"))); + address appGateway = vm.envAddress("APP_GATEWAY"); + + address sender = vm.addr(privateKey); + console.log("Sender address:", sender); + uint256 balance = sender.balance; + console.log("Sender balance in wei:", balance); + + uint feesAmount = 0.1 ether; + feesPlug.deposit{value: feesAmount}(ETH_ADDRESS, appGateway, feesAmount); + } +} diff --git a/script/robust/triggerseq.sol b/script/robust/triggerseq.sol new file mode 100644 index 0000000..c51f582 --- /dev/null +++ b/script/robust/triggerseq.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {RobDep} from "../../src/robust/RobDep.sol"; +import {RobAG} from "../../src/robust/RobAG.sol"; +import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; +import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; + +contract CounterDeploy is Script { + function run() external { + string memory rpc = vm.envString("OFF_CHAIN_VM_RPC"); + vm.createSelectFork(rpc); + + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + // Fees memory fees = Fees({feePoolChain: 421614, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); + + RobAG gateway = RobAG(vm.envAddress("APP_GATEWAY")); + gateway.triggerParallelWrite(0x3B67A1Db62895a915ce42CAB6d496D4D492715C3); + + console.log("Contracts deployed:"); + } +} diff --git a/src/robust/RobAG.sol b/src/robust/RobAG.sol new file mode 100644 index 0000000..c22e404 --- /dev/null +++ b/src/robust/RobAG.sol @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.7.0 <0.9.0; + +import "socket-protocol/contracts/base/AppGatewayBase.sol"; +// import "socket-protocol/contracts/protocol/utils/common/Structs.sol"; +import "./RobPlug.sol"; + +contract RobAG is AppGatewayBase { + + uint256[] public values; + uint256[] public resolveTimes; + + uint256[] public timeouts = [1, 10, 20, 30, 40, 50, 100, 500, 1000, 10000]; + + + + constructor(address addressResolver_, address deployerContract_, address auctionManager_, Fees memory fees_) + AppGatewayBase(addressResolver_, auctionManager_) + { + addressResolver__.setContractsToGateways(deployerContract_); + _setOverrides(fees_); + } + + function triggerSequentialWrite(address instance_) public async { + _setOverrides(Read.OFF, Parallel.OFF); + for (uint256 i = 0; i < 10; i++) { + RobPlug(instance_).increase(); + } + } + + function triggerParallelWrite(address instance_) public async { + _setOverrides(Read.OFF, Parallel.ON); + for (uint256 i = 0; i < 10; i++) { + RobPlug(instance_).increase(); + } + } + + function triggerAltWrite(address instance1_, address instance2_) public async { + _setOverrides(Read.OFF, Parallel.OFF); + for (uint256 i = 0; i < 5; i++) { + RobPlug(instance1_).increase(); + RobPlug(instance2_).increase(); + } + } + + function triggerRead(address instance_) public async { + _setOverrides(Read.ON, Parallel.ON); + for (uint256 i = 0; i < 10; i++) { + RobPlug(instance_).getValue(i); + IPromise(instance_).then(this.setValue.selector, abi.encode(i)); + } + } + + function triggerAltRead(address instance1_, address instance2_) public async { + _setOverrides(Read.ON, Parallel.ON); + for (uint256 i = 0; i < 10; i++) { + if (i % 2 == 0) { + RobPlug(instance1_).getValue(i); + IPromise(instance1_).then(this.setValue.selector, abi.encode(i)); + } else { + RobPlug(instance2_).getValue(i); + IPromise(instance2_).then(this.setValue.selector, abi.encode(i)); + } + } + } + + function triggerReadAndWrite(address instance_) public async { + _setOverrides(Read.ON, Parallel.OFF); + RobPlug(instance_).getValue(0); + IPromise(instance_).then(this.setValue.selector, abi.encode(0)); + RobPlug(instance_).getValue(1); + IPromise(instance_).then(this.setValue.selector, abi.encode(1)); + + _setOverrides(Read.OFF); + RobPlug(instance_).increase(); + RobPlug(instance_).increase(); + + _setOverrides(Read.ON); + RobPlug(instance_).getValue(2); + IPromise(instance_).then(this.setValue.selector, abi.encode(2)); + RobPlug(instance_).getValue(3); + IPromise(instance_).then(this.setValue.selector, abi.encode(3)); + + _setOverrides(Read.OFF); + RobPlug(instance_).increase(); + RobPlug(instance_).increase(); + } + + function triggerTimeouts() public { + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 0 + ), + 1 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 1 + ), + 10 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 2 + ), + 20 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 3 + ), + 30 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 4 + ), + 40 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 5 + ), + 50 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 6 + ), + 100 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 7 + ), + 500 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 8 + ), + 1000 + ); + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + 9 + ), + 10000 + ); + } + + function resolveTimeout(uint256 index_) public { + resolveTimes[index_] = block.timestamp; + } + + function setValue(bytes memory data, bytes memory returnData) public onlyPromises { + uint256 index_ = abi.decode(data, (uint256)); + uint256 value_ = abi.decode(returnData, (uint256)); + values[index_] = value_; + } + + function setFees(Fees memory fees_) public { + fees = fees_; + } + + function withdrawFeeTokens(uint32 chainSlug_, address token_, uint256 amount_, address receiver_) external { + _withdrawFeeTokens(chainSlug_, token_, amount_, receiver_); + } +} diff --git a/src/robust/RobDep.sol b/src/robust/RobDep.sol new file mode 100644 index 0000000..80c321e --- /dev/null +++ b/src/robust/RobDep.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.7.0 <0.9.0; + +import "./RobPlug.sol"; +import "socket-protocol/contracts/base/AppDeployerBase.sol"; + +contract RobDep is AppDeployerBase { + bytes32 public rob = _createContractId("Rob"); + + constructor(address addressResolver_, address auctionManager_, bytes32 sbType_, Fees memory fees_) + AppDeployerBase(addressResolver_, auctionManager_, sbType_) + { + creationCodeWithArgs[rob] = abi.encodePacked(type(RobPlug).creationCode); + _setOverrides(fees_); + } + + function deployContracts(uint32 chainSlug_) external async { + _deploy(rob, chainSlug_, IsPlug.YES); + } + +// function initialize(uint32) public pure override { +// return; +// } + + function setFees(Fees memory fees_) public { + fees = fees_; + } +} diff --git a/src/robust/RobPlug.sol b/src/robust/RobPlug.sol new file mode 100644 index 0000000..1bbcf0d --- /dev/null +++ b/src/robust/RobPlug.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.7.0 <0.9.0; + +import "socket-protocol/contracts/base/PlugBase.sol"; + +contract RobPlug is PlugBase { + uint256 public counter; + + uint256[] public values; + + function increase() external onlySocket { + counter++; + } + + function setValues(uint256[] memory values_) external { + values[0] = values_[0]; + values[1] = values_[1]; + values[2] = values_[2]; + values[3] = values_[3]; + values[4] = values_[4]; + values[5] = values_[5]; + values[6] = values_[6]; + values[7] = values_[7]; + values[8] = values_[8]; + values[9] = values_[9]; + } + + function getValue(uint256 index_) external view returns (uint256) { + return values[index_]; + } + + function connectSocket( + address appGateway_, + address socket_, + address switchboard_ + ) external { + _connectSocket(appGateway_, socket_, switchboard_); + } +} From 7ba186378a7330cd1fd1326d04ea0c013c3040b1 Mon Sep 17 00:00:00 2001 From: arthcp Date: Sun, 23 Feb 2025 16:13:22 +0400 Subject: [PATCH 02/11] feat: changes --- .env.sample | 2 +- script/robust/deployEVMx.sol | 2 +- script/robust/deployPlugs.sol | 2 +- script/robust/deposit.sol | 2 +- script/robust/triggerseq.sol | 2 +- src/robust/IRobPlug.sol | 20 ++++++ src/robust/RobAG.sol | 128 ++++++++-------------------------- src/robust/RobPlug.sol | 1 + 8 files changed, 54 insertions(+), 105 deletions(-) create mode 100644 src/robust/IRobPlug.sol diff --git a/.env.sample b/.env.sample index 8aab70e..d9fc3ca 100644 --- a/.env.sample +++ b/.env.sample @@ -1,7 +1,7 @@ PRIVATE_KEY="0x" WALLET_ADDRESS="0x" -OFF_CHAIN_VM_RPC="https://rpc-socket-composer-testnet.t.conduit.xyz" +EVMX_RPC="https://rpc-socket-composer-testnet.t.conduit.xyz" SEPOLIA_RPC="https://rpc.ankr.com/eth_sepolia/" SEPOLIA_API_KEY="empty" diff --git a/script/robust/deployEVMx.sol b/script/robust/deployEVMx.sol index c440324..d799223 100644 --- a/script/robust/deployEVMx.sol +++ b/script/robust/deployEVMx.sol @@ -12,7 +12,7 @@ contract CounterDeploy is Script { function run() external { address addressResolver = vm.envAddress("ADDRESS_RESOLVER"); address auctionManager = vm.envAddress("AUCTION_MANAGER"); - string memory rpc = vm.envString("OFF_CHAIN_VM_RPC"); + string memory rpc = vm.envString("EVMX_RPC"); vm.createSelectFork(rpc); uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); diff --git a/script/robust/deployPlugs.sol b/script/robust/deployPlugs.sol index dfb86a0..4f52e83 100644 --- a/script/robust/deployPlugs.sol +++ b/script/robust/deployPlugs.sol @@ -10,7 +10,7 @@ import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common contract CounterDeploy is Script { function run() external { - string memory rpc = vm.envString("OFF_CHAIN_VM_RPC"); + string memory rpc = vm.envString("EVMX_RPC"); vm.createSelectFork(rpc); uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); diff --git a/script/robust/deposit.sol b/script/robust/deposit.sol index 3f51d03..d630925 100644 --- a/script/robust/deposit.sol +++ b/script/robust/deposit.sol @@ -21,7 +21,7 @@ contract DepositFees is Script { uint256 balance = sender.balance; console.log("Sender balance in wei:", balance); - uint feesAmount = 0.1 ether; + uint feesAmount = 0.01 ether; feesPlug.deposit{value: feesAmount}(ETH_ADDRESS, appGateway, feesAmount); } } diff --git a/script/robust/triggerseq.sol b/script/robust/triggerseq.sol index c51f582..c5eb039 100644 --- a/script/robust/triggerseq.sol +++ b/script/robust/triggerseq.sol @@ -10,7 +10,7 @@ import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common contract CounterDeploy is Script { function run() external { - string memory rpc = vm.envString("OFF_CHAIN_VM_RPC"); + string memory rpc = vm.envString("EVMX_RPC"); vm.createSelectFork(rpc); uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); diff --git a/src/robust/IRobPlug.sol b/src/robust/IRobPlug.sol new file mode 100644 index 0000000..84797f4 --- /dev/null +++ b/src/robust/IRobPlug.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.7.0 <0.9.0; + +interface IRobPlug { + function counter() external; + + function values() external; + + function increase() external; + + function setValues(uint256[] memory values_) external; + + function getValue(uint256 index_) external; + + function connectSocket( + address appGateway_, + address socket_, + address switchboard_ + ) external; +} diff --git a/src/robust/RobAG.sol b/src/robust/RobAG.sol index c22e404..d7f7867 100644 --- a/src/robust/RobAG.sol +++ b/src/robust/RobAG.sol @@ -3,16 +3,14 @@ pragma solidity >=0.7.0 <0.9.0; import "socket-protocol/contracts/base/AppGatewayBase.sol"; // import "socket-protocol/contracts/protocol/utils/common/Structs.sol"; -import "./RobPlug.sol"; +import "./IRobPlug.sol"; contract RobAG is AppGatewayBase { uint256[] public values; - uint256[] public resolveTimes; - - uint256[] public timeouts = [1, 10, 20, 30, 40, 50, 100, 500, 1000, 10000]; - + uint256[] public resolveTimes = new uint256[](10); + uint256[] public timeoutDurations = [1, 10, 20, 30, 40, 50, 100, 500, 1000, 10000]; constructor(address addressResolver_, address deployerContract_, address auctionManager_, Fees memory fees_) AppGatewayBase(addressResolver_, auctionManager_) @@ -24,29 +22,29 @@ contract RobAG is AppGatewayBase { function triggerSequentialWrite(address instance_) public async { _setOverrides(Read.OFF, Parallel.OFF); for (uint256 i = 0; i < 10; i++) { - RobPlug(instance_).increase(); + IRobPlug(instance_).increase(); } } function triggerParallelWrite(address instance_) public async { _setOverrides(Read.OFF, Parallel.ON); for (uint256 i = 0; i < 10; i++) { - RobPlug(instance_).increase(); + IRobPlug(instance_).increase(); } } function triggerAltWrite(address instance1_, address instance2_) public async { _setOverrides(Read.OFF, Parallel.OFF); for (uint256 i = 0; i < 5; i++) { - RobPlug(instance1_).increase(); - RobPlug(instance2_).increase(); + IRobPlug(instance1_).increase(); + IRobPlug(instance2_).increase(); } } function triggerRead(address instance_) public async { _setOverrides(Read.ON, Parallel.ON); for (uint256 i = 0; i < 10; i++) { - RobPlug(instance_).getValue(i); + IRobPlug(instance_).getValue(i); IPromise(instance_).then(this.setValue.selector, abi.encode(i)); } } @@ -55,10 +53,10 @@ contract RobAG is AppGatewayBase { _setOverrides(Read.ON, Parallel.ON); for (uint256 i = 0; i < 10; i++) { if (i % 2 == 0) { - RobPlug(instance1_).getValue(i); + IRobPlug(instance1_).getValue(i); IPromise(instance1_).then(this.setValue.selector, abi.encode(i)); } else { - RobPlug(instance2_).getValue(i); + IRobPlug(instance2_).getValue(i); IPromise(instance2_).then(this.setValue.selector, abi.encode(i)); } } @@ -66,107 +64,37 @@ contract RobAG is AppGatewayBase { function triggerReadAndWrite(address instance_) public async { _setOverrides(Read.ON, Parallel.OFF); - RobPlug(instance_).getValue(0); + IRobPlug(instance_).getValue(0); IPromise(instance_).then(this.setValue.selector, abi.encode(0)); - RobPlug(instance_).getValue(1); + IRobPlug(instance_).getValue(1); IPromise(instance_).then(this.setValue.selector, abi.encode(1)); _setOverrides(Read.OFF); - RobPlug(instance_).increase(); - RobPlug(instance_).increase(); + IRobPlug(instance_).increase(); + IRobPlug(instance_).increase(); _setOverrides(Read.ON); - RobPlug(instance_).getValue(2); + IRobPlug(instance_).getValue(2); IPromise(instance_).then(this.setValue.selector, abi.encode(2)); - RobPlug(instance_).getValue(3); + IRobPlug(instance_).getValue(3); IPromise(instance_).then(this.setValue.selector, abi.encode(3)); _setOverrides(Read.OFF); - RobPlug(instance_).increase(); - RobPlug(instance_).increase(); + IRobPlug(instance_).increase(); + IRobPlug(instance_).increase(); } function triggerTimeouts() public { - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 0 - ), - 1 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 1 - ), - 10 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 2 - ), - 20 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 3 - ), - 30 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 4 - ), - 40 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 5 - ), - 50 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 6 - ), - 100 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 7 - ), - 500 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 8 - ), - 1000 - ); - watcherPrecompile__().setTimeout( - address(this), - abi.encodeWithSelector( - this.resolveTimeout.selector, - 9 - ), - 10000 - ); + for (uint256 i = 0; i < timeoutDurations.length; i++) { + watcherPrecompile__().setTimeout( + address(this), + abi.encodeWithSelector( + this.resolveTimeout.selector, + i + ), + timeoutDurations[i] + ); + } } function resolveTimeout(uint256 index_) public { diff --git a/src/robust/RobPlug.sol b/src/robust/RobPlug.sol index 1bbcf0d..33134b7 100644 --- a/src/robust/RobPlug.sol +++ b/src/robust/RobPlug.sol @@ -13,6 +13,7 @@ contract RobPlug is PlugBase { } function setValues(uint256[] memory values_) external { + values = new uint256[](10); values[0] = values_[0]; values[1] = values_[1]; values[2] = values_[2]; From 797d205f78b7d06a86c6cb9142875a8caff91e3d Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Tue, 25 Feb 2025 14:50:18 +0000 Subject: [PATCH 03/11] Clean up branch --- lib/socket-protocol | 2 +- script/robust/deployEVMx.sol | 10 +++---- script/robust/deployPlugs.sol | 11 ++----- script/robust/deposit.sol | 27 ----------------- script/robust/triggerseq.sol | 13 ++------ src/apps/counter/Counter.sol | 20 ------------- src/apps/counter/CounterAppGateway.sol | 30 ------------------- src/apps/counter/CounterDeployer.sol | 28 ----------------- src/{ => apps}/robust/IRobPlug.sol | 0 .../robust/RobAppGateway.sol} | 3 +- .../robust/RobDeployer.sol} | 8 ++--- src/{ => apps}/robust/RobPlug.sol | 0 test/Dummy.t.sol | 8 +++++ 13 files changed, 25 insertions(+), 135 deletions(-) delete mode 100644 script/robust/deposit.sol delete mode 100644 src/apps/counter/Counter.sol delete mode 100644 src/apps/counter/CounterAppGateway.sol delete mode 100644 src/apps/counter/CounterDeployer.sol rename src/{ => apps}/robust/IRobPlug.sol (100%) rename src/{robust/RobAG.sol => apps/robust/RobAppGateway.sol} (97%) rename src/{robust/RobDep.sol => apps/robust/RobDeployer.sol} (85%) rename src/{ => apps}/robust/RobPlug.sol (100%) create mode 100644 test/Dummy.t.sol diff --git a/lib/socket-protocol b/lib/socket-protocol index 3e63529..4f163cd 160000 --- a/lib/socket-protocol +++ b/lib/socket-protocol @@ -1 +1 @@ -Subproject commit 3e635291a0e5bb6a7f6f1bc504c1096534cbb199 +Subproject commit 4f163cd0c10d2b09b4c49d5956aea8c01687f42a diff --git a/script/robust/deployEVMx.sol b/script/robust/deployEVMx.sol index d799223..dfa1c5d 100644 --- a/script/robust/deployEVMx.sol +++ b/script/robust/deployEVMx.sol @@ -3,12 +3,12 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; -import {RobDep} from "../../src/robust/RobDep.sol"; -import {RobAG} from "../../src/robust/RobAG.sol"; +import {RobDeployer} from "../../src/apps/robust/RobDeployer.sol"; +import {RobAppGateway} from "../../src/apps/robust/RobAppGateway.sol"; import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; -contract CounterDeploy is Script { +contract DeployEVMxContracts is Script { function run() external { address addressResolver = vm.envAddress("ADDRESS_RESOLVER"); address auctionManager = vm.envAddress("AUCTION_MANAGER"); @@ -20,9 +20,9 @@ contract CounterDeploy is Script { Fees memory fees = Fees({feePoolChain: 421614, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); - RobDep deployer = new RobDep(addressResolver, auctionManager, FAST, fees); + RobDeployer deployer = new RobDeployer(addressResolver, auctionManager, FAST, fees); - RobAG gateway = new RobAG(addressResolver, address(deployer), auctionManager, fees); + RobAppGateway gateway = new RobAppGateway(addressResolver, address(deployer), auctionManager, fees); console.log("Contracts deployed:"); console.log("RobDep:", address(deployer)); diff --git a/script/robust/deployPlugs.sol b/script/robust/deployPlugs.sol index 4f52e83..f0de529 100644 --- a/script/robust/deployPlugs.sol +++ b/script/robust/deployPlugs.sol @@ -3,12 +3,9 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; -import {RobDep} from "../../src/robust/RobDep.sol"; -import {RobAG} from "../../src/robust/RobAG.sol"; -import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; -import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; +import {RobDeployer} from "../../src/apps/robust/RobDeployer.sol"; -contract CounterDeploy is Script { +contract DeployOnchainContracts is Script { function run() external { string memory rpc = vm.envString("EVMX_RPC"); vm.createSelectFork(rpc); @@ -16,9 +13,7 @@ contract CounterDeploy is Script { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); - // Fees memory fees = Fees({feePoolChain: 421614, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); - - RobDep deployer = RobDep(vm.envAddress("APP_DEPLOYER")); + RobDeployer deployer = RobDeployer(vm.envAddress("APP_DEPLOYER")); deployer.deployContracts(11155420); deployer.deployContracts(421614); diff --git a/script/robust/deposit.sol b/script/robust/deposit.sol deleted file mode 100644 index d630925..0000000 --- a/script/robust/deposit.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import {Script} from "forge-std/Script.sol"; -import {console} from "forge-std/console.sol"; -import {FeesPlug} from "socket-protocol/contracts/protocol/payload-delivery/FeesPlug.sol"; -import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; -import {ETH_ADDRESS} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; - -contract DepositFees is Script { - function run() external { - vm.createSelectFork(vm.envString("ARBITRUM_SEPOLIA_RPC")); - - uint256 privateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(privateKey); - FeesPlug feesPlug = FeesPlug(payable(vm.envAddress("ARBITRUM_FEES_PLUG"))); - address appGateway = vm.envAddress("APP_GATEWAY"); - - address sender = vm.addr(privateKey); - console.log("Sender address:", sender); - uint256 balance = sender.balance; - console.log("Sender balance in wei:", balance); - - uint feesAmount = 0.01 ether; - feesPlug.deposit{value: feesAmount}(ETH_ADDRESS, appGateway, feesAmount); - } -} diff --git a/script/robust/triggerseq.sol b/script/robust/triggerseq.sol index c5eb039..33aaf32 100644 --- a/script/robust/triggerseq.sol +++ b/script/robust/triggerseq.sol @@ -3,12 +3,9 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; -import {RobDep} from "../../src/robust/RobDep.sol"; -import {RobAG} from "../../src/robust/RobAG.sol"; -import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; -import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; +import {RobAppGateway} from "../../src/apps/robust/RobAppGateway.sol"; -contract CounterDeploy is Script { +contract ParallelWrite is Script { function run() external { string memory rpc = vm.envString("EVMX_RPC"); vm.createSelectFork(rpc); @@ -16,11 +13,7 @@ contract CounterDeploy is Script { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); - // Fees memory fees = Fees({feePoolChain: 421614, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); - - RobAG gateway = RobAG(vm.envAddress("APP_GATEWAY")); + RobAppGateway gateway = RobAppGateway(vm.envAddress("APP_GATEWAY")); gateway.triggerParallelWrite(0x3B67A1Db62895a915ce42CAB6d496D4D492715C3); - - console.log("Contracts deployed:"); } } diff --git a/src/apps/counter/Counter.sol b/src/apps/counter/Counter.sol deleted file mode 100644 index 30e82b9..0000000 --- a/src/apps/counter/Counter.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity >=0.7.0 <0.9.0; - -import "socket-protocol/contracts/base/PlugBase.sol"; - -contract Counter is PlugBase { - uint256 public counter; - - function increase() external onlySocket { - counter++; - } - - function connectSocket( - address appGateway_, - address socket_, - address switchboard_ - ) external { - _connectSocket(appGateway_, socket_, switchboard_); - } -} diff --git a/src/apps/counter/CounterAppGateway.sol b/src/apps/counter/CounterAppGateway.sol deleted file mode 100644 index dc7fd82..0000000 --- a/src/apps/counter/CounterAppGateway.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity >=0.7.0 <0.9.0; - -import "socket-protocol/contracts/base/AppGatewayBase.sol"; -import "./Counter.sol"; - -contract CounterAppGateway is AppGatewayBase { - constructor(address addressResolver_, address deployerContract_, address auctionManager_, Fees memory fees_) - AppGatewayBase(addressResolver_, auctionManager_) - { - addressResolver__.setContractsToGateways(deployerContract_); - _setOverrides(fees_); - } - - function incrementCounters(address[] memory instances_) public async { - // the increase function is called on given list of instances - // this - for (uint256 i = 0; i < instances_.length; i++) { - Counter(instances_[i]).increase(); - } - } - - function setFees(Fees memory fees_) public { - fees = fees_; - } - - function withdrawFeeTokens(uint32 chainSlug_, address token_, uint256 amount_, address receiver_) external { - _withdrawFeeTokens(chainSlug_, token_, amount_, receiver_); - } -} diff --git a/src/apps/counter/CounterDeployer.sol b/src/apps/counter/CounterDeployer.sol deleted file mode 100644 index 412271c..0000000 --- a/src/apps/counter/CounterDeployer.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity >=0.7.0 <0.9.0; - -import "./Counter.sol"; -import "socket-protocol/contracts/base/AppDeployerBase.sol"; - -contract CounterDeployer is AppDeployerBase { - bytes32 public counter = _createContractId("counter"); - - constructor(address addressResolver_, address auctionManager_, bytes32 sbType_, Fees memory fees_) - AppDeployerBase(addressResolver_, auctionManager_, sbType_) - { - creationCodeWithArgs[counter] = abi.encodePacked(type(Counter).creationCode); - _setOverrides(fees_); - } - - function deployContracts(uint32 chainSlug_) external async { - _deploy(counter, chainSlug_, IsPlug.YES); - } - - function initialize(uint32) public pure override { - return; - } - - function setFees(Fees memory fees_) public { - fees = fees_; - } -} diff --git a/src/robust/IRobPlug.sol b/src/apps/robust/IRobPlug.sol similarity index 100% rename from src/robust/IRobPlug.sol rename to src/apps/robust/IRobPlug.sol diff --git a/src/robust/RobAG.sol b/src/apps/robust/RobAppGateway.sol similarity index 97% rename from src/robust/RobAG.sol rename to src/apps/robust/RobAppGateway.sol index d7f7867..d4905dd 100644 --- a/src/robust/RobAG.sol +++ b/src/apps/robust/RobAppGateway.sol @@ -2,10 +2,9 @@ pragma solidity >=0.7.0 <0.9.0; import "socket-protocol/contracts/base/AppGatewayBase.sol"; -// import "socket-protocol/contracts/protocol/utils/common/Structs.sol"; import "./IRobPlug.sol"; -contract RobAG is AppGatewayBase { +contract RobAppGateway is AppGatewayBase { uint256[] public values; uint256[] public resolveTimes = new uint256[](10); diff --git a/src/robust/RobDep.sol b/src/apps/robust/RobDeployer.sol similarity index 85% rename from src/robust/RobDep.sol rename to src/apps/robust/RobDeployer.sol index 80c321e..cfd9430 100644 --- a/src/robust/RobDep.sol +++ b/src/apps/robust/RobDeployer.sol @@ -4,7 +4,7 @@ pragma solidity >=0.7.0 <0.9.0; import "./RobPlug.sol"; import "socket-protocol/contracts/base/AppDeployerBase.sol"; -contract RobDep is AppDeployerBase { +contract RobDeployer is AppDeployerBase { bytes32 public rob = _createContractId("Rob"); constructor(address addressResolver_, address auctionManager_, bytes32 sbType_, Fees memory fees_) @@ -18,9 +18,9 @@ contract RobDep is AppDeployerBase { _deploy(rob, chainSlug_, IsPlug.YES); } -// function initialize(uint32) public pure override { -// return; -// } + function initialize(uint32) public pure override { + return; + } function setFees(Fees memory fees_) public { fees = fees_; diff --git a/src/robust/RobPlug.sol b/src/apps/robust/RobPlug.sol similarity index 100% rename from src/robust/RobPlug.sol rename to src/apps/robust/RobPlug.sol diff --git a/test/Dummy.t.sol b/test/Dummy.t.sol new file mode 100644 index 0000000..1d0e27e --- /dev/null +++ b/test/Dummy.t.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.21; + +import "socket-protocol/test/DeliveryHelper.t.sol"; + +contract DummyTest is DeliveryHelperTest { + function testDummy() external {} +} From c35e4d0f6160caea10e9142bd820ad651bc22002 Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:19:06 +0000 Subject: [PATCH 04/11] Update .env.sample addresses --- .env.sample | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.sample b/.env.sample index ab55e93..b08675c 100644 --- a/.env.sample +++ b/.env.sample @@ -7,10 +7,10 @@ BASE_SEPOLIA_RPC="https://rpc.ankr.com/base_sepolia" # EVMx key addresses # Find the most up to date addresses in deployments/dev_addresses.json -ADDRESS_RESOLVER="0x7480D8D4B1929e751984b01eE877A9D65e1F3737" -AUCTION_MANAGER="0x50E5140d3601812Dc11f49a39CF9520567731c82" -ARBITRUM_FEES_PLUG="0xa08Dac27E27c49A2535b36064c370e6e8B3A0B9a" -FEES_MANAGER="0x80bEc58A00993dc874Ab2fAe56621af24eF06bA5" +ADDRESS_RESOLVER="0xFEB7040121E8E1a181b914eA291345a5433F924E" +AUCTION_MANAGER="0xf285F94468b08Cdd1390d0F88C780165E4C0F4aC" +ARBITRUM_FEES_PLUG="0xA201b638954cc449D55f3D19d8723Eb008B5923E" +FEES_MANAGER="0x57B9fe7A9032Af38431a8F3037A32459aE909490" # Add your deployer private key here # or remove it from this file if it is already an env var From c52d2561739eb1ef8c324ed1981099efd3002d1e Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:00:21 +0000 Subject: [PATCH 05/11] [WIP] Add script to run robustness tests --- script/robust/RunEVMxRobustness.s.sol | 106 ++++++++++++++++++++++++++ script/robust/deployEVMx.sol | 4 +- script/robust/deployPlugs.sol | 2 +- 3 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 script/robust/RunEVMxRobustness.s.sol diff --git a/script/robust/RunEVMxRobustness.s.sol b/script/robust/RunEVMxRobustness.s.sol new file mode 100644 index 0000000..30bcfaa --- /dev/null +++ b/script/robust/RunEVMxRobustness.s.sol @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {RobDeployer} from "../../src/apps/robust/RobDeployer.sol"; +import {RobAppGateway} from "../../src/apps/robust/RobAppGateway.sol"; +import {DepositFees} from "socket-protocol/script/PayFeesInArbitrumETH.s.sol"; +import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; +import {FeesPlug} from "socket-protocol/contracts/protocol/payload-delivery/FeesPlug.sol"; +import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; +import {FeesManager} from "socket-protocol/contracts/protocol/payload-delivery/app-gateway/FeesManager.sol"; + +contract RunEVMxRobustness is Script { + // ----- ENVIRONMENT VARIABLES ----- + string rpcEVMx = vm.envString("EVMX_RPC"); + string rpcArbSepolia = vm.envString("ARBITRUM_SEPOLIA_RPC"); + address addressResolver = vm.envAddress("ADDRESS_RESOLVER"); + address auctionManager = vm.envAddress("AUCTION_MANAGER"); + address feesPlugArbSepolia = vm.envAddress("ARBITRUM_FEES_PLUG"); + address feesManagerAddress = vm.envAddress("FEES_MANAGER"); + uint256 privateKey = vm.envUint("PRIVATE_KEY"); + address deployerAddress = vm.envAddress("DEPLOYER"); + address appGatewayAddress = vm.envAddress("APP_GATEWAY"); + + // ----- SCRIPT VARIABLES ----- + uint32 arbSepChainId = 411614; + uint32 opSepChainId = 11155420; + Fees fees = Fees({feePoolChain: arbSepChainId, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); + FeesManager feesManager = FeesManager(payable(feesManagerAddress)); + FeesPlug feesPlug = FeesPlug(payable(feesPlugArbSepolia)); + + function checkDepositedFees(uint32 chainId, address appGateway) internal returns (uint256 availableFees) { + vm.createSelectFork(rpcEVMx); + + (uint256 deposited, uint256 blocked) = feesManager.appGatewayFeeBalances(appGateway, chainId, ETH_ADDRESS); + console.log("App Gateway:", appGateway); + console.log("Deposited fees:", deposited); + console.log("Blocked fees:", blocked); + + availableFees = feesManager.getAvailableFees(chainId, appGateway, ETH_ADDRESS); + console.log("Available fees:", availableFees); + } + + function withdrawAppFees(uint32 chainId) internal { + // EVMX Check available fees + vm.createSelectFork(rpcEVMx); + + uint256 availableFees = feesManager.getAvailableFees(chainId, appGatewayAddress, ETH_ADDRESS); + console.log("Available fees:", availableFees); + + if (availableFees > 0) { + // Switch to Arbitrum Sepolia to get gas price + vm.createSelectFork(rpcArbSepolia); + + // Gas price from Arbitrum + uint256 arbitrumGasPrice = block.basefee + 0.1 gwei; // With buffer + uint256 gasLimit = 5_000_000; // Estimate + uint256 estimatedGasCost = gasLimit * arbitrumGasPrice; + + console.log("Arbitrum gas price (wei):", arbitrumGasPrice); + console.log("Gas limit:", gasLimit); + console.log("Estimated gas cost:", estimatedGasCost); + + // Calculate amount to withdraw + uint256 amountToWithdraw = availableFees > estimatedGasCost ? availableFees - estimatedGasCost : 0; + + if (amountToWithdraw > 0) { + // Switch back to EVMX to perform withdrawal + vm.createSelectFork(rpcEVMx); + vm.startBroadcast(privateKey); + address sender = vm.addr(privateKey); + console.log("Withdrawing amount:", amountToWithdraw); + RobAppGateway appGateway = RobAppGateway(appGatewayAddress); + appGateway.withdrawFeeTokens(chainId, ETH_ADDRESS, amountToWithdraw, sender); + vm.stopBroadcast(); + + // Switch back to Arbitrum Sepolia to check final balance + vm.createSelectFork(rpcArbSepolia); + console.log("Final sender balance:", sender.balance); + } else { + console.log("Available fees less than estimated gas cost"); + } + } + } + + function deployOnchainContracts() internal { + vm.createSelectFork(rpcEVMx); + vm.startBroadcast(privateKey); + RobDeployer deployer = RobDeployer(deployerAddress); + deployer.deployContracts(opSepChainId); + deployer.deployContracts(arbSepChainId); + + console.log("Contracts deployed:"); + } + + function run() external { + uint256 availableFees = checkDepositedFees(arbSepChainId, appGatewayAddress); + if (availableFees > 0) { + deployOnchainContracts(); + withdrawAppFees(arbSepChainId); + } else { + console.log("NO AVAILABLE FEES"); + } + } +} diff --git a/script/robust/deployEVMx.sol b/script/robust/deployEVMx.sol index dfa1c5d..7de0409 100644 --- a/script/robust/deployEVMx.sol +++ b/script/robust/deployEVMx.sol @@ -25,7 +25,7 @@ contract DeployEVMxContracts is Script { RobAppGateway gateway = new RobAppGateway(addressResolver, address(deployer), auctionManager, fees); console.log("Contracts deployed:"); - console.log("RobDep:", address(deployer)); - console.log("RobAG:", address(gateway)); + console.log("Deployer:", address(deployer)); + console.log("AppGateway:", address(gateway)); } } diff --git a/script/robust/deployPlugs.sol b/script/robust/deployPlugs.sol index f0de529..9c6b446 100644 --- a/script/robust/deployPlugs.sol +++ b/script/robust/deployPlugs.sol @@ -13,7 +13,7 @@ contract DeployOnchainContracts is Script { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); - RobDeployer deployer = RobDeployer(vm.envAddress("APP_DEPLOYER")); + RobDeployer deployer = RobDeployer(vm.envAddress("DEPLOYER")); deployer.deployContracts(11155420); deployer.deployContracts(421614); From 39172a262e1f11f7397a0fabd6c21f4b1e1fa932 Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:49:36 +0000 Subject: [PATCH 06/11] Update EMV details --- .env.sample | 10 +++++----- foundry.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.sample b/.env.sample index b08675c..5259b5c 100644 --- a/.env.sample +++ b/.env.sample @@ -1,5 +1,5 @@ # RPCs -EVMX_RPC="https://rpc-evmx.dev.socket.tech/" +EVMX_RPC="https://rpc-evmx.dev.socket.tech" SEPOLIA_RPC="https://rpc.ankr.com/eth_sepolia/" ARBITRUM_SEPOLIA_RPC="https://rpc.ankr.com/arbitrum_sepolia" OPTIMISM_SEPOLIA_RPC="https://rpc.ankr.com/optimism_sepolia" @@ -7,10 +7,10 @@ BASE_SEPOLIA_RPC="https://rpc.ankr.com/base_sepolia" # EVMx key addresses # Find the most up to date addresses in deployments/dev_addresses.json -ADDRESS_RESOLVER="0xFEB7040121E8E1a181b914eA291345a5433F924E" -AUCTION_MANAGER="0xf285F94468b08Cdd1390d0F88C780165E4C0F4aC" -ARBITRUM_FEES_PLUG="0xA201b638954cc449D55f3D19d8723Eb008B5923E" -FEES_MANAGER="0x57B9fe7A9032Af38431a8F3037A32459aE909490" +ADDRESS_RESOLVER="0x35a72Ef57aCC20a8e1Ef39A0f903cE23175779b1" +AUCTION_MANAGER="0xA9377140B51c8c5be91e73D03e5E32DC841Cd4C0" +ARBITRUM_FEES_PLUG="0xB45CD3697Bfd0F5dA17787F0e113C2807303BEAc" +FEES_MANAGER="0x2C4B5dac446AB96A3dd92b6bd7ec48151BDd8f9C" # Add your deployer private key here # or remove it from this file if it is already an env var diff --git a/foundry.toml b/foundry.toml index 59a3602..f55ee7f 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,6 +10,6 @@ evm_version = 'paris' # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options [etherscan] -7625382 = { key = "empty", url = "https://evms.cloud.blockscout.com/api?" } +7625382 = { key = "empty", url = "https://evmx2.cloud.blockscout.com/api?" } 421614 = { key = "${ARBISCAN_API_KEY}", url = "https://api-sepolia.arbiscan.io/api?" } 11155420 = { key = "${OPTIMISM_API_KEY}", url = "https://optimism-sepolia.blockscout.com/api?" } From ef2b42b265f55e56461135968d6560da0f4ee561 Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Wed, 26 Feb 2025 10:27:29 +0000 Subject: [PATCH 07/11] Add EVMx robustness script --- script/robust/RunEVMxRobustness.s.sol | 107 +++++++++++++++++++++++--- src/apps/robust/RobAppGateway.sol | 2 +- 2 files changed, 99 insertions(+), 10 deletions(-) diff --git a/script/robust/RunEVMxRobustness.s.sol b/script/robust/RunEVMxRobustness.s.sol index 30bcfaa..74c5cff 100644 --- a/script/robust/RunEVMxRobustness.s.sol +++ b/script/robust/RunEVMxRobustness.s.sol @@ -26,19 +26,26 @@ contract RunEVMxRobustness is Script { // ----- SCRIPT VARIABLES ----- uint32 arbSepChainId = 411614; uint32 opSepChainId = 11155420; + Fees fees = Fees({feePoolChain: arbSepChainId, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); FeesManager feesManager = FeesManager(payable(feesManagerAddress)); FeesPlug feesPlug = FeesPlug(payable(feesPlugArbSepolia)); - function checkDepositedFees(uint32 chainId, address appGateway) internal returns (uint256 availableFees) { + RobDeployer deployer = RobDeployer(deployerAddress); + RobAppGateway appGateway = RobAppGateway(appGatewayAddress); + address opSepForwarder; + address arbSepForwarder; + + function checkDepositedFees(uint32 chainId) internal returns (uint256 availableFees) { vm.createSelectFork(rpcEVMx); - (uint256 deposited, uint256 blocked) = feesManager.appGatewayFeeBalances(appGateway, chainId, ETH_ADDRESS); - console.log("App Gateway:", appGateway); + (uint256 deposited, uint256 blocked) = + feesManager.appGatewayFeeBalances(appGatewayAddress, chainId, ETH_ADDRESS); + console.log("App Gateway:", appGatewayAddress); console.log("Deposited fees:", deposited); console.log("Blocked fees:", blocked); - availableFees = feesManager.getAvailableFees(chainId, appGateway, ETH_ADDRESS); + availableFees = feesManager.getAvailableFees(chainId, appGatewayAddress, ETH_ADDRESS); console.log("Available fees:", availableFees); } @@ -71,7 +78,6 @@ contract RunEVMxRobustness is Script { vm.startBroadcast(privateKey); address sender = vm.addr(privateKey); console.log("Withdrawing amount:", amountToWithdraw); - RobAppGateway appGateway = RobAppGateway(appGatewayAddress); appGateway.withdrawFeeTokens(chainId, ETH_ADDRESS, amountToWithdraw, sender); vm.stopBroadcast(); @@ -87,20 +93,103 @@ contract RunEVMxRobustness is Script { function deployOnchainContracts() internal { vm.createSelectFork(rpcEVMx); vm.startBroadcast(privateKey); - RobDeployer deployer = RobDeployer(deployerAddress); deployer.deployContracts(opSepChainId); deployer.deployContracts(arbSepChainId); + vm.stopBroadcast(); - console.log("Contracts deployed:"); + console.log("Contracts deployed"); + } + + function getForwarderAddresses() internal { + vm.createSelectFork(rpcEVMx); + opSepForwarder = deployer.forwarderAddresses(deployer.rob(), opSepChainId); + arbSepForwarder = deployer.forwarderAddresses(deployer.rob(), arbSepChainId); + + console.log("Optimism Sepolia Forwarder:", opSepForwarder); + console.log("Arbitrum Sepolia Forwarder:", arbSepForwarder); + } + + function runAllTriggers() internal { + vm.createSelectFork(rpcEVMx); + vm.startBroadcast(privateKey); + + console.log("Running all trigger functions..."); + + // 1. Trigger Sequential Write + console.log("triggerSequentialWrite..."); + appGateway.triggerSequentialWrite(opSepForwarder); + + // 2. Trigger Parallel Write + console.log("triggerParallelWrite..."); + appGateway.triggerParallelWrite(arbSepForwarder); + + // 3. Trigger Alternating Write between chains + console.log("triggerAltWrite..."); + appGateway.triggerAltWrite(opSepForwarder, arbSepForwarder); + + // 4. Trigger Parallel Read + console.log("triggerParallelRead..."); + appGateway.triggerParallelRead(opSepForwarder); + + // 5. Trigger Alternating Read between chains + console.log("triggerAltRead..."); + appGateway.triggerAltRead(opSepForwarder, arbSepForwarder); + + // 6. Trigger Read and Write + console.log("triggerReadAndWrite..."); + appGateway.triggerReadAndWrite(arbSepForwarder); + + // 7. Trigger Timeouts + console.log("triggerTimeouts..."); + appGateway.triggerTimeouts(); + + vm.stopBroadcast(); + console.log("All triggers executed successfully"); + } + + function checkResults() internal { + vm.createSelectFork(rpcEVMx); + + console.log("\n----- RESULTS -----"); + + // Check values array + console.log("Values array:"); + for (uint256 i = 0; i < 10; i++) { + try appGateway.values(i) returns (uint256 value) { + console.log("values[%s]: %s", i, value); + } catch { + console.log("values[%s]: not set", i); + break; + } + } + + // Check resolve times for timeouts + console.log("\nTimeout resolve times:"); + for (uint256 i = 0; i < 10; i++) { + uint256 resolveTime = appGateway.resolveTimes(i); + uint256 duration = appGateway.timeoutDurations(i); + if (resolveTime > 0) { + console.log("Timeout %s (duration %s): resolved at timestamp %s", i, duration, resolveTime); + } else { + console.log("Timeout %s (duration %s): not yet resolved", i, duration); + } + } } function run() external { - uint256 availableFees = checkDepositedFees(arbSepChainId, appGatewayAddress); + uint256 availableFees = checkDepositedFees(arbSepChainId); + if (availableFees > 0) { + // Set up onchain deployments deployOnchainContracts(); + getForwarderAddresses(); + + runAllTriggers(); + checkResults(); // TODO: Check if we need to wait before checking the results + withdrawAppFees(arbSepChainId); } else { - console.log("NO AVAILABLE FEES"); + console.log("NO AVAILABLE FEES - Please deposit fees before running this script"); } } } diff --git a/src/apps/robust/RobAppGateway.sol b/src/apps/robust/RobAppGateway.sol index d4905dd..0b9f118 100644 --- a/src/apps/robust/RobAppGateway.sol +++ b/src/apps/robust/RobAppGateway.sol @@ -40,7 +40,7 @@ contract RobAppGateway is AppGatewayBase { } } - function triggerRead(address instance_) public async { + function triggerParallelRead(address instance_) public async { _setOverrides(Read.ON, Parallel.ON); for (uint256 i = 0; i < 10; i++) { IRobPlug(instance_).getValue(i); From b2dbea8c68ee4a204f9cf79b48eb5ea9b5fde1aa Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Wed, 26 Feb 2025 10:29:39 +0000 Subject: [PATCH 08/11] Remove unused scripts --- script/robust/deployPlugs.sol | 22 ---------------------- script/robust/triggerseq.sol | 19 ------------------- 2 files changed, 41 deletions(-) delete mode 100644 script/robust/deployPlugs.sol delete mode 100644 script/robust/triggerseq.sol diff --git a/script/robust/deployPlugs.sol b/script/robust/deployPlugs.sol deleted file mode 100644 index 9c6b446..0000000 --- a/script/robust/deployPlugs.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import {Script} from "forge-std/Script.sol"; -import {console} from "forge-std/console.sol"; -import {RobDeployer} from "../../src/apps/robust/RobDeployer.sol"; - -contract DeployOnchainContracts is Script { - function run() external { - string memory rpc = vm.envString("EVMX_RPC"); - vm.createSelectFork(rpc); - - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(deployerPrivateKey); - - RobDeployer deployer = RobDeployer(vm.envAddress("DEPLOYER")); - deployer.deployContracts(11155420); - deployer.deployContracts(421614); - - console.log("Contracts deployed:"); - } -} diff --git a/script/robust/triggerseq.sol b/script/robust/triggerseq.sol deleted file mode 100644 index 33aaf32..0000000 --- a/script/robust/triggerseq.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import {Script} from "forge-std/Script.sol"; -import {console} from "forge-std/console.sol"; -import {RobAppGateway} from "../../src/apps/robust/RobAppGateway.sol"; - -contract ParallelWrite is Script { - function run() external { - string memory rpc = vm.envString("EVMX_RPC"); - vm.createSelectFork(rpc); - - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(deployerPrivateKey); - - RobAppGateway gateway = RobAppGateway(vm.envAddress("APP_GATEWAY")); - gateway.triggerParallelWrite(0x3B67A1Db62895a915ce42CAB6d496D4D492715C3); - } -} From 688958f12c544cb280bfa67eacc8f3689ac9bed0 Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Wed, 26 Feb 2025 10:37:39 +0000 Subject: [PATCH 09/11] Rename for clarity --- script/robust/RunEVMxRobustness.s.sol | 12 +++---- script/robust/deployEVMx.sol | 8 ++--- ...IRobPlug.sol => IRobustnessMultichain.sol} | 2 +- ...ppGateway.sol => RobustnessAppGateway.sol} | 34 +++++++++---------- ...RobDeployer.sol => RobustnessDeployer.sol} | 6 ++-- .../{RobPlug.sol => RobustnessMultichain.sol} | 2 +- 6 files changed, 32 insertions(+), 32 deletions(-) rename src/apps/robust/{IRobPlug.sol => IRobustnessMultichain.sol} (92%) rename src/apps/robust/{RobAppGateway.sol => RobustnessAppGateway.sol} (78%) rename src/apps/robust/{RobDeployer.sol => RobustnessDeployer.sol} (78%) rename src/apps/robust/{RobPlug.sol => RobustnessMultichain.sol} (95%) diff --git a/script/robust/RunEVMxRobustness.s.sol b/script/robust/RunEVMxRobustness.s.sol index 74c5cff..a7dd121 100644 --- a/script/robust/RunEVMxRobustness.s.sol +++ b/script/robust/RunEVMxRobustness.s.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; -import {RobDeployer} from "../../src/apps/robust/RobDeployer.sol"; -import {RobAppGateway} from "../../src/apps/robust/RobAppGateway.sol"; +import {RobustnessDeployer} from "../../src/apps/robust/RobustnessDeployer.sol"; +import {RobustnessAppGateway} from "../../src/apps/robust/RobustnessAppGateway.sol"; import {DepositFees} from "socket-protocol/script/PayFeesInArbitrumETH.s.sol"; import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; import {FeesPlug} from "socket-protocol/contracts/protocol/payload-delivery/FeesPlug.sol"; @@ -31,8 +31,8 @@ contract RunEVMxRobustness is Script { FeesManager feesManager = FeesManager(payable(feesManagerAddress)); FeesPlug feesPlug = FeesPlug(payable(feesPlugArbSepolia)); - RobDeployer deployer = RobDeployer(deployerAddress); - RobAppGateway appGateway = RobAppGateway(appGatewayAddress); + RobustnessDeployer deployer = RobustnessDeployer(deployerAddress); + RobustnessAppGateway appGateway = RobustnessAppGateway(appGatewayAddress); address opSepForwarder; address arbSepForwarder; @@ -102,8 +102,8 @@ contract RunEVMxRobustness is Script { function getForwarderAddresses() internal { vm.createSelectFork(rpcEVMx); - opSepForwarder = deployer.forwarderAddresses(deployer.rob(), opSepChainId); - arbSepForwarder = deployer.forwarderAddresses(deployer.rob(), arbSepChainId); + opSepForwarder = deployer.forwarderAddresses(deployer.multichain(), opSepChainId); + arbSepForwarder = deployer.forwarderAddresses(deployer.multichain(), arbSepChainId); console.log("Optimism Sepolia Forwarder:", opSepForwarder); console.log("Arbitrum Sepolia Forwarder:", arbSepForwarder); diff --git a/script/robust/deployEVMx.sol b/script/robust/deployEVMx.sol index 7de0409..34d0229 100644 --- a/script/robust/deployEVMx.sol +++ b/script/robust/deployEVMx.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; -import {RobDeployer} from "../../src/apps/robust/RobDeployer.sol"; -import {RobAppGateway} from "../../src/apps/robust/RobAppGateway.sol"; +import {RobustnessDeployer} from "../../src/apps/robust/RobustnessDeployer.sol"; +import {RobustnessAppGateway} from "../../src/apps/robust/RobustnessAppGateway.sol"; import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; @@ -20,9 +20,9 @@ contract DeployEVMxContracts is Script { Fees memory fees = Fees({feePoolChain: 421614, feePoolToken: ETH_ADDRESS, amount: 0.001 ether}); - RobDeployer deployer = new RobDeployer(addressResolver, auctionManager, FAST, fees); + RobustnessDeployer deployer = new RobustnessDeployer(addressResolver, auctionManager, FAST, fees); - RobAppGateway gateway = new RobAppGateway(addressResolver, address(deployer), auctionManager, fees); + RobustnessAppGateway gateway = new RobustnessAppGateway(addressResolver, address(deployer), auctionManager, fees); console.log("Contracts deployed:"); console.log("Deployer:", address(deployer)); diff --git a/src/apps/robust/IRobPlug.sol b/src/apps/robust/IRobustnessMultichain.sol similarity index 92% rename from src/apps/robust/IRobPlug.sol rename to src/apps/robust/IRobustnessMultichain.sol index 84797f4..eadbf8b 100644 --- a/src/apps/robust/IRobPlug.sol +++ b/src/apps/robust/IRobustnessMultichain.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; -interface IRobPlug { +interface IRobustnessMultichain { function counter() external; function values() external; diff --git a/src/apps/robust/RobAppGateway.sol b/src/apps/robust/RobustnessAppGateway.sol similarity index 78% rename from src/apps/robust/RobAppGateway.sol rename to src/apps/robust/RobustnessAppGateway.sol index 0b9f118..b385fcb 100644 --- a/src/apps/robust/RobAppGateway.sol +++ b/src/apps/robust/RobustnessAppGateway.sol @@ -2,9 +2,9 @@ pragma solidity >=0.7.0 <0.9.0; import "socket-protocol/contracts/base/AppGatewayBase.sol"; -import "./IRobPlug.sol"; +import "./IRobustnessMultichain.sol"; -contract RobAppGateway is AppGatewayBase { +contract RobustnessAppGateway is AppGatewayBase { uint256[] public values; uint256[] public resolveTimes = new uint256[](10); @@ -21,29 +21,29 @@ contract RobAppGateway is AppGatewayBase { function triggerSequentialWrite(address instance_) public async { _setOverrides(Read.OFF, Parallel.OFF); for (uint256 i = 0; i < 10; i++) { - IRobPlug(instance_).increase(); + IRobustnessMultichain(instance_).increase(); } } function triggerParallelWrite(address instance_) public async { _setOverrides(Read.OFF, Parallel.ON); for (uint256 i = 0; i < 10; i++) { - IRobPlug(instance_).increase(); + IRobustnessMultichain(instance_).increase(); } } function triggerAltWrite(address instance1_, address instance2_) public async { _setOverrides(Read.OFF, Parallel.OFF); for (uint256 i = 0; i < 5; i++) { - IRobPlug(instance1_).increase(); - IRobPlug(instance2_).increase(); + IRobustnessMultichain(instance1_).increase(); + IRobustnessMultichain(instance2_).increase(); } } function triggerParallelRead(address instance_) public async { _setOverrides(Read.ON, Parallel.ON); for (uint256 i = 0; i < 10; i++) { - IRobPlug(instance_).getValue(i); + IRobustnessMultichain(instance_).getValue(i); IPromise(instance_).then(this.setValue.selector, abi.encode(i)); } } @@ -52,10 +52,10 @@ contract RobAppGateway is AppGatewayBase { _setOverrides(Read.ON, Parallel.ON); for (uint256 i = 0; i < 10; i++) { if (i % 2 == 0) { - IRobPlug(instance1_).getValue(i); + IRobustnessMultichain(instance1_).getValue(i); IPromise(instance1_).then(this.setValue.selector, abi.encode(i)); } else { - IRobPlug(instance2_).getValue(i); + IRobustnessMultichain(instance2_).getValue(i); IPromise(instance2_).then(this.setValue.selector, abi.encode(i)); } } @@ -63,24 +63,24 @@ contract RobAppGateway is AppGatewayBase { function triggerReadAndWrite(address instance_) public async { _setOverrides(Read.ON, Parallel.OFF); - IRobPlug(instance_).getValue(0); + IRobustnessMultichain(instance_).getValue(0); IPromise(instance_).then(this.setValue.selector, abi.encode(0)); - IRobPlug(instance_).getValue(1); + IRobustnessMultichain(instance_).getValue(1); IPromise(instance_).then(this.setValue.selector, abi.encode(1)); _setOverrides(Read.OFF); - IRobPlug(instance_).increase(); - IRobPlug(instance_).increase(); + IRobustnessMultichain(instance_).increase(); + IRobustnessMultichain(instance_).increase(); _setOverrides(Read.ON); - IRobPlug(instance_).getValue(2); + IRobustnessMultichain(instance_).getValue(2); IPromise(instance_).then(this.setValue.selector, abi.encode(2)); - IRobPlug(instance_).getValue(3); + IRobustnessMultichain(instance_).getValue(3); IPromise(instance_).then(this.setValue.selector, abi.encode(3)); _setOverrides(Read.OFF); - IRobPlug(instance_).increase(); - IRobPlug(instance_).increase(); + IRobustnessMultichain(instance_).increase(); + IRobustnessMultichain(instance_).increase(); } function triggerTimeouts() public { diff --git a/src/apps/robust/RobDeployer.sol b/src/apps/robust/RobustnessDeployer.sol similarity index 78% rename from src/apps/robust/RobDeployer.sol rename to src/apps/robust/RobustnessDeployer.sol index cfd9430..118ea9e 100644 --- a/src/apps/robust/RobDeployer.sol +++ b/src/apps/robust/RobustnessDeployer.sol @@ -1,16 +1,16 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; -import "./RobPlug.sol"; +import "./RobustnessMultichain.sol"; import "socket-protocol/contracts/base/AppDeployerBase.sol"; -contract RobDeployer is AppDeployerBase { +contract RobustnessDeployer is AppDeployerBase { bytes32 public rob = _createContractId("Rob"); constructor(address addressResolver_, address auctionManager_, bytes32 sbType_, Fees memory fees_) AppDeployerBase(addressResolver_, auctionManager_, sbType_) { - creationCodeWithArgs[rob] = abi.encodePacked(type(RobPlug).creationCode); + creationCodeWithArgs[multichain] = abi.encodePacked(type(RobustnessMultichain).creationCode); _setOverrides(fees_); } diff --git a/src/apps/robust/RobPlug.sol b/src/apps/robust/RobustnessMultichain.sol similarity index 95% rename from src/apps/robust/RobPlug.sol rename to src/apps/robust/RobustnessMultichain.sol index 33134b7..1f657df 100644 --- a/src/apps/robust/RobPlug.sol +++ b/src/apps/robust/RobustnessMultichain.sol @@ -3,7 +3,7 @@ pragma solidity >=0.7.0 <0.9.0; import "socket-protocol/contracts/base/PlugBase.sol"; -contract RobPlug is PlugBase { +contract RobustnessMultichain is PlugBase { uint256 public counter; uint256[] public values; From b2605647a358305cfb8cea6b8437e2976f5de449 Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Wed, 26 Feb 2025 10:55:23 +0000 Subject: [PATCH 10/11] Add missing rename --- script/robust/deployEVMx.sol | 3 ++- src/apps/robust/RobustnessDeployer.sol | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/script/robust/deployEVMx.sol b/script/robust/deployEVMx.sol index 34d0229..83c8af8 100644 --- a/script/robust/deployEVMx.sol +++ b/script/robust/deployEVMx.sol @@ -22,7 +22,8 @@ contract DeployEVMxContracts is Script { RobustnessDeployer deployer = new RobustnessDeployer(addressResolver, auctionManager, FAST, fees); - RobustnessAppGateway gateway = new RobustnessAppGateway(addressResolver, address(deployer), auctionManager, fees); + RobustnessAppGateway gateway = + new RobustnessAppGateway(addressResolver, address(deployer), auctionManager, fees); console.log("Contracts deployed:"); console.log("Deployer:", address(deployer)); diff --git a/src/apps/robust/RobustnessDeployer.sol b/src/apps/robust/RobustnessDeployer.sol index 118ea9e..01d9250 100644 --- a/src/apps/robust/RobustnessDeployer.sol +++ b/src/apps/robust/RobustnessDeployer.sol @@ -5,7 +5,7 @@ import "./RobustnessMultichain.sol"; import "socket-protocol/contracts/base/AppDeployerBase.sol"; contract RobustnessDeployer is AppDeployerBase { - bytes32 public rob = _createContractId("Rob"); + bytes32 public multichain = _createContractId("RobustnessMultichain"); constructor(address addressResolver_, address auctionManager_, bytes32 sbType_, Fees memory fees_) AppDeployerBase(addressResolver_, auctionManager_, sbType_) @@ -15,7 +15,7 @@ contract RobustnessDeployer is AppDeployerBase { } function deployContracts(uint32 chainSlug_) external async { - _deploy(rob, chainSlug_, IsPlug.YES); + _deploy(multichain, chainSlug_, IsPlug.YES); } function initialize(uint32) public pure override { From c762f1e911478bcb5ca0b394e368aef924803c8b Mon Sep 17 00:00:00 2001 From: Rookmate <14072042+rookmate@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:44:30 +0000 Subject: [PATCH 11/11] Standardize with deploy tests PR --- script/robust/RunEVMxRobustness.s.sol | 4 ++-- script/robust/deployEVMx.sol | 4 ++-- src/{apps/robust => robustness}/IRobustnessMultichain.sol | 0 src/{apps/robust => robustness}/RobustnessAppGateway.sol | 0 src/{apps/robust => robustness}/RobustnessDeployer.sol | 0 src/{apps/robust => robustness}/RobustnessMultichain.sol | 0 6 files changed, 4 insertions(+), 4 deletions(-) rename src/{apps/robust => robustness}/IRobustnessMultichain.sol (100%) rename src/{apps/robust => robustness}/RobustnessAppGateway.sol (100%) rename src/{apps/robust => robustness}/RobustnessDeployer.sol (100%) rename src/{apps/robust => robustness}/RobustnessMultichain.sol (100%) diff --git a/script/robust/RunEVMxRobustness.s.sol b/script/robust/RunEVMxRobustness.s.sol index a7dd121..bbfd07f 100644 --- a/script/robust/RunEVMxRobustness.s.sol +++ b/script/robust/RunEVMxRobustness.s.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; -import {RobustnessDeployer} from "../../src/apps/robust/RobustnessDeployer.sol"; -import {RobustnessAppGateway} from "../../src/apps/robust/RobustnessAppGateway.sol"; +import {RobustnessDeployer} from "../../src/robustness/RobustnessDeployer.sol"; +import {RobustnessAppGateway} from "../../src/robustness/RobustnessAppGateway.sol"; import {DepositFees} from "socket-protocol/script/PayFeesInArbitrumETH.s.sol"; import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; import {FeesPlug} from "socket-protocol/contracts/protocol/payload-delivery/FeesPlug.sol"; diff --git a/script/robust/deployEVMx.sol b/script/robust/deployEVMx.sol index 83c8af8..9cac1f1 100644 --- a/script/robust/deployEVMx.sol +++ b/script/robust/deployEVMx.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; -import {RobustnessDeployer} from "../../src/apps/robust/RobustnessDeployer.sol"; -import {RobustnessAppGateway} from "../../src/apps/robust/RobustnessAppGateway.sol"; +import {RobustnessDeployer} from "../../src/robustness/RobustnessDeployer.sol"; +import {RobustnessAppGateway} from "../../src/robustness/RobustnessAppGateway.sol"; import {Fees} from "socket-protocol/contracts/protocol/utils/common/Structs.sol"; import {ETH_ADDRESS, FAST} from "socket-protocol/contracts/protocol/utils/common/Constants.sol"; diff --git a/src/apps/robust/IRobustnessMultichain.sol b/src/robustness/IRobustnessMultichain.sol similarity index 100% rename from src/apps/robust/IRobustnessMultichain.sol rename to src/robustness/IRobustnessMultichain.sol diff --git a/src/apps/robust/RobustnessAppGateway.sol b/src/robustness/RobustnessAppGateway.sol similarity index 100% rename from src/apps/robust/RobustnessAppGateway.sol rename to src/robustness/RobustnessAppGateway.sol diff --git a/src/apps/robust/RobustnessDeployer.sol b/src/robustness/RobustnessDeployer.sol similarity index 100% rename from src/apps/robust/RobustnessDeployer.sol rename to src/robustness/RobustnessDeployer.sol diff --git a/src/apps/robust/RobustnessMultichain.sol b/src/robustness/RobustnessMultichain.sol similarity index 100% rename from src/apps/robust/RobustnessMultichain.sol rename to src/robustness/RobustnessMultichain.sol