diff --git a/codecov.yml b/codecov.yml index aa9bfb581b..75cb98e364 100644 --- a/codecov.yml +++ b/codecov.yml @@ -9,7 +9,7 @@ ignore: - "contracts/src/utils" - "contracts/src/ScaleCodec.sol" - "contracts/src/SubstrateTypes.sol" - - "contracts/src/DeployScript.sol" + - "contracts/scripts" flags: solidity: paths: diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 24dea2d8e9..f16b5be662 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -4,6 +4,7 @@ optimizer = true optimizer_runs = 20_000 via_ir = true test = 'test' +script = 'scripts' fs_permissions = [{ access = "read-write", path = "test/data"}, { access = "read", path = "./"}] ignored_error_codes = [ diff --git a/contracts/src/DeployGatewayLogic.sol b/contracts/scripts/DeployGatewayLogic.sol similarity index 66% rename from contracts/src/DeployGatewayLogic.sol rename to contracts/scripts/DeployGatewayLogic.sol index 8c5cc70282..e8009d568f 100644 --- a/contracts/src/DeployGatewayLogic.sol +++ b/contracts/scripts/DeployGatewayLogic.sol @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: 2023 Snowfork pragma solidity 0.8.23; -import {AgentExecutor} from "./AgentExecutor.sol"; -import {Gateway} from "./Gateway.sol"; -import {ParaID} from "./Types.sol"; +import {AgentExecutor} from "../src/AgentExecutor.sol"; +import {Gateway} from "../src//Gateway.sol"; +import {ParaID} from "../src//Types.sol"; import {Script} from "forge-std/Script.sol"; import {stdJson} from "forge-std/StdJson.sol"; @@ -24,9 +24,18 @@ contract DeployGatewayLogic is Script { bytes32 bridgeHubAgentID = vm.envBytes32("BRIDGE_HUB_AGENT_ID"); uint8 foreignTokenDecimals = uint8(vm.envUint("FOREIGN_TOKEN_DECIMALS")); + uint128 maxDestinationFee = uint128(vm.envUint("RESERVE_TRANSFER_MAX_DESTINATION_FEE")); AgentExecutor executor = new AgentExecutor(); - new Gateway(address(beefyClient), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals); + + new Gateway( + address(beefyClient), + address(executor), + bridgeHubParaID, + bridgeHubAgentID, + foreignTokenDecimals, + maxDestinationFee + ); vm.stopBroadcast(); } diff --git a/contracts/src/DeployScript.sol b/contracts/scripts/DeployScript.sol similarity index 85% rename from contracts/src/DeployScript.sol rename to contracts/scripts/DeployScript.sol index 8290d9ff8e..e3ec406ee7 100644 --- a/contracts/src/DeployScript.sol +++ b/contracts/scripts/DeployScript.sol @@ -4,16 +4,15 @@ pragma solidity 0.8.23; import {WETH9} from "canonical-weth/WETH9.sol"; import {Script} from "forge-std/Script.sol"; -import {BeefyClient} from "./BeefyClient.sol"; - -import {IGateway} from "./interfaces/IGateway.sol"; -import {GatewayProxy} from "./GatewayProxy.sol"; -import {Gateway} from "./Gateway.sol"; -import {GatewayUpgradeMock} from "../test/mocks/GatewayUpgradeMock.sol"; -import {Agent} from "./Agent.sol"; -import {AgentExecutor} from "./AgentExecutor.sol"; -import {ChannelID, ParaID, OperatingMode} from "./Types.sol"; -import {SafeNativeTransfer} from "./utils/SafeTransfer.sol"; +import {BeefyClient} from "../src/BeefyClient.sol"; + +import {IGateway} from "../src/interfaces/IGateway.sol"; +import {GatewayProxy} from "../src/GatewayProxy.sol"; +import {Gateway} from "../src/Gateway.sol"; +import {Agent} from "../src/Agent.sol"; +import {AgentExecutor} from "../src/AgentExecutor.sol"; +import {ChannelID, ParaID, OperatingMode} from "../src/Types.sol"; +import {SafeNativeTransfer} from "../src/utils/SafeTransfer.sol"; import {stdJson} from "forge-std/StdJson.sol"; import {UD60x18, ud60x18} from "prb/math/src/UD60x18.sol"; @@ -58,10 +57,16 @@ contract DeployScript is Script { bytes32 assetHubAgentID = vm.envBytes32("ASSET_HUB_AGENT_ID"); uint8 foreignTokenDecimals = uint8(vm.envUint("FOREIGN_TOKEN_DECIMALS")); + uint128 maxDestinationFee = uint128(vm.envUint("RESERVE_TRANSFER_MAX_DESTINATION_FEE")); AgentExecutor executor = new AgentExecutor(); Gateway gatewayLogic = new Gateway( - address(beefyClient), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals + address(beefyClient), + address(executor), + bridgeHubParaID, + bridgeHubAgentID, + foreignTokenDecimals, + maxDestinationFee ); bool rejectOutboundMessages = vm.envBool("REJECT_OUTBOUND_MESSAGES"); @@ -99,8 +104,6 @@ contract DeployScript is Script { payable(bridgeHubAgent).safeNativeTransfer(initialDeposit); payable(assetHubAgent).safeNativeTransfer(initialDeposit); - new GatewayUpgradeMock(); - vm.stopBroadcast(); } } diff --git a/contracts/src/FundAgent.sol b/contracts/scripts/FundAgent.sol similarity index 73% rename from contracts/src/FundAgent.sol rename to contracts/scripts/FundAgent.sol index 95192299c0..bda15cda17 100644 --- a/contracts/src/FundAgent.sol +++ b/contracts/scripts/FundAgent.sol @@ -4,16 +4,15 @@ pragma solidity 0.8.23; import {WETH9} from "canonical-weth/WETH9.sol"; import {Script} from "forge-std/Script.sol"; -import {BeefyClient} from "./BeefyClient.sol"; - -import {IGateway} from "./interfaces/IGateway.sol"; -import {GatewayProxy} from "./GatewayProxy.sol"; -import {Gateway} from "./Gateway.sol"; -import {GatewayUpgradeMock} from "../test/mocks/GatewayUpgradeMock.sol"; -import {Agent} from "./Agent.sol"; -import {AgentExecutor} from "./AgentExecutor.sol"; -import {ParaID} from "./Types.sol"; -import {SafeNativeTransfer} from "./utils/SafeTransfer.sol"; +import {BeefyClient} from "../src/BeefyClient.sol"; + +import {IGateway} from "../src/interfaces/IGateway.sol"; +import {GatewayProxy} from "../src/GatewayProxy.sol"; +import {Gateway} from "../src/Gateway.sol"; +import {Agent} from "../src/Agent.sol"; +import {AgentExecutor} from "../src/AgentExecutor.sol"; +import {ParaID} from "../src/Types.sol"; +import {SafeNativeTransfer} from "../src/utils/SafeTransfer.sol"; import {stdJson} from "forge-std/StdJson.sol"; contract FundAgent is Script { diff --git a/contracts/src/Assets.sol b/contracts/src/Assets.sol index a1ccac2ff5..1262df6650 100644 --- a/contracts/src/Assets.sol +++ b/contracts/src/Assets.sol @@ -42,21 +42,22 @@ library Assets { IERC20(token).safeTransferFrom(sender, agent, amount); } - function sendTokenCosts(address token, ParaID destinationChain, uint128 destinationChainFee) - external - view - returns (Costs memory costs) - { + function sendTokenCosts( + address token, + ParaID destinationChain, + uint128 destinationChainFee, + uint128 maxDestinationChainFee + ) external view returns (Costs memory costs) { AssetsStorage.Layout storage $ = AssetsStorage.layout(); TokenInfo storage info = $.tokenRegistry[token]; if (!info.isRegistered) { revert TokenNotRegistered(); } - return _sendTokenCosts(destinationChain, destinationChainFee); + return _sendTokenCosts(destinationChain, destinationChainFee, maxDestinationChainFee); } - function _sendTokenCosts(ParaID destinationChain, uint128 destinationChainFee) + function _sendTokenCosts(ParaID destinationChain, uint128 destinationChainFee, uint128 maxDestinationChainFee) internal view returns (Costs memory costs) @@ -65,6 +66,19 @@ library Assets { if ($.assetHubParaID == destinationChain) { costs.foreign = $.assetHubReserveTransferFee; } else { + // Reduce the ability for users to perform arbitrage by exploiting a + // favourable exchange rate. For example supplying Ether + // and gaining a more valuable amount of DOT on the destination chain. + // + // Also prevents users from mistakenly sending more fees than would be required + // which has negative effects like draining AssetHub's sovereign account. + // + // For safety, `maxDestinationChainFee` should be less valuable + // than the gas cost to send tokens. + if (destinationChainFee > maxDestinationChainFee) { + revert InvalidDestinationFee(); + } + // If the final destination chain is not AssetHub, then the fee needs to additionally // include the cost of executing an XCM on the final destination parachain. costs.foreign = $.assetHubReserveTransferFee + destinationChainFee; @@ -79,6 +93,7 @@ library Assets { ParaID destinationChain, MultiAddress calldata destinationAddress, uint128 destinationChainFee, + uint128 maxDestinationChainFee, uint128 amount ) external returns (Ticket memory ticket) { AssetsStorage.Layout storage $ = AssetsStorage.layout(); @@ -92,7 +107,7 @@ library Assets { _transferToAgent($.assetHubAgent, token, sender, amount); ticket.dest = $.assetHubParaID; - ticket.costs = _sendTokenCosts(destinationChain, destinationChainFee); + ticket.costs = _sendTokenCosts(destinationChain, destinationChainFee, maxDestinationChainFee); // Construct a message payload if (destinationChain == $.assetHubParaID) { diff --git a/contracts/src/BeefyClient.sol b/contracts/src/BeefyClient.sol index eeb27bfc42..7f46e697f2 100644 --- a/contracts/src/BeefyClient.sol +++ b/contracts/src/BeefyClient.sol @@ -35,6 +35,13 @@ contract BeefyClient { */ event NewMMRRoot(bytes32 mmrRoot, uint64 blockNumber); + /** + * @dev Emitted when a new ticket has been created + * @param relayer The relayer who created the ticket + * @param blockNumber the parent block number of the candidate MMR root + */ + event NewTicket(address relayer, uint64 blockNumber); + /* Types */ /** @@ -289,6 +296,8 @@ contract BeefyClient { prevRandao: 0, bitfieldHash: keccak256(abi.encodePacked(bitfield)) }); + + emit NewTicket(msg.sender, commitment.blockNumber); } /** diff --git a/contracts/src/Gateway.sol b/contracts/src/Gateway.sol index 086a2694c3..ea6cab493c 100644 --- a/contracts/src/Gateway.sol +++ b/contracts/src/Gateway.sol @@ -21,8 +21,10 @@ import { OriginKind, Weight } from "./Types.sol"; +import {Upgrade} from "./Upgrade.sol"; import {IGateway} from "./interfaces/IGateway.sol"; import {IInitializable} from "./interfaces/IInitializable.sol"; +import {IUpgradable} from "./interfaces/IUpgradable.sol"; import {ERC1967} from "./utils/ERC1967.sol"; import {Address} from "./utils/Address.sol"; import {SafeNativeTransfer} from "./utils/SafeTransfer.sol"; @@ -49,7 +51,7 @@ import {AssetsStorage} from "./storage/AssetsStorage.sol"; import {UD60x18, ud60x18, convert} from "prb/math/src/UD60x18.sol"; -contract Gateway is IGateway, IInitializable { +contract Gateway is IGateway, IInitializable, IUpgradable { using Address for address; using SafeNativeTransfer for address payable; @@ -72,6 +74,13 @@ contract Gateway is IGateway, IInitializable { // 2. Calling implementation function uint256 DISPATCH_OVERHEAD_GAS = 10_000; + // The maximum fee that can be sent to a destination parachain to pay for execution (DOT). + // Has two functions: + // * Reduces the ability of users to perform arbitrage using a favourable exchange rate + // * Prevents users from mistakenly providing too much fees, which would drain AssetHub's + // sovereign account here on Ethereum. + uint128 internal immutable MAX_DESTINATION_FEE; + uint8 internal immutable FOREIGN_TOKEN_DECIMALS; error InvalidProof(); @@ -87,12 +96,11 @@ contract Gateway is IGateway, IInitializable { error InvalidChannelUpdate(); error AgentExecutionFailed(bytes returndata); error InvalidAgentExecutionPayload(); - error InvalidCodeHash(); error InvalidConstructorParams(); error AlreadyInitialized(); error InvalidTransact(); - // handler functions are privileged + // Message handlers can only be dispatched by the gateway itself modifier onlySelf() { if (msg.sender != address(this)) { revert Unauthorized(); @@ -105,7 +113,8 @@ contract Gateway is IGateway, IInitializable { address agentExecutor, ParaID bridgeHubParaID, bytes32 bridgeHubAgentID, - uint8 foreignTokenDecimals + uint8 foreignTokenDecimals, + uint128 maxDestinationFee ) { if (bridgeHubParaID == ParaID.wrap(0) || bridgeHubAgentID == 0) { revert InvalidConstructorParams(); @@ -117,6 +126,7 @@ contract Gateway is IGateway, IInitializable { BRIDGE_HUB_PARA_ID = bridgeHubParaID; BRIDGE_HUB_AGENT_ID = bridgeHubAgentID; FOREIGN_TOKEN_DECIMALS = foreignTokenDecimals; + MAX_DESTINATION_FEE = maxDestinationFee; } /// @dev Submit a message from Polkadot for verification and dispatch @@ -335,29 +345,7 @@ contract Gateway is IGateway, IInitializable { /// @dev Perform an upgrade of the gateway function upgrade(bytes calldata data) external onlySelf { UpgradeParams memory params = abi.decode(data, (UpgradeParams)); - - // Verify that the implementation is actually a contract - if (!params.impl.isContract()) { - revert InvalidCodeHash(); - } - - // As a sanity check, ensure that the codehash of implementation contract - // matches the codehash in the upgrade proposal - if (params.impl.codehash != params.implCodeHash) { - revert InvalidCodeHash(); - } - - // Update the proxy with the address of the new implementation - ERC1967.store(params.impl); - - // Apply the initialization function of the implementation only if params were provided - if (params.initParams.length > 0) { - (bool success, bytes memory returndata) = - params.impl.delegatecall(abi.encodeCall(IInitializable.initialize, params.initParams)); - Call.verifyResult(success, returndata); - } - - emit Upgraded(params.impl); + Upgrade.upgrade(params.impl, params.implCodeHash, params.initParams); } // @dev Set the operating mode of the gateway @@ -421,7 +409,7 @@ contract Gateway is IGateway, IInitializable { view returns (uint256) { - return _calculateFee(Assets.sendTokenCosts(token, destinationChain, destinationFee)); + return _calculateFee(Assets.sendTokenCosts(token, destinationChain, destinationFee, MAX_DESTINATION_FEE)); } // Transfer ERC20 tokens to a Polkadot parachain @@ -433,7 +421,9 @@ contract Gateway is IGateway, IInitializable { uint128 amount ) external payable { _submitOutbound( - Assets.sendToken(token, msg.sender, destinationChain, destinationAddress, destinationFee, amount) + Assets.sendToken( + token, msg.sender, destinationChain, destinationAddress, destinationFee, MAX_DESTINATION_FEE, amount + ) ); } @@ -591,10 +581,6 @@ contract Gateway is IGateway, IInitializable { CoreStorage.Layout storage core = CoreStorage.layout(); - if (core.channels[PRIMARY_GOVERNANCE_CHANNEL_ID].agent != address(0)) { - revert AlreadyInitialized(); - } - Config memory config = abi.decode(data, (Config)); core.mode = config.mode; diff --git a/contracts/src/Shell.sol b/contracts/src/Shell.sol new file mode 100644 index 0000000000..2654a8685b --- /dev/null +++ b/contracts/src/Shell.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pragma solidity 0.8.23; + +import {Upgrade} from "./Upgrade.sol"; +import {IInitializable} from "./interfaces/IInitializable.sol"; +import {IUpgradable} from "./interfaces/IUpgradable.sol"; +import {IShell} from "./interfaces/IShell.sol"; + +// address recoveryOperator = vm.envOr("RECOVERY_OPERATOR", address(0)); + +contract Shell is IShell, IUpgradable, IInitializable { + address public immutable operator; + + error Unauthorised(); + + constructor(address _operator) { + operator = _operator; + } + + function upgrade(address impl, bytes32 implCodeHash, bytes calldata initializerParams) external { + if (msg.sender != operator) { + revert Unauthorised(); + } + Upgrade.upgrade(impl, implCodeHash, initializerParams); + } + + function initialize(bytes memory params) external {} +} diff --git a/contracts/src/Upgrade.sol b/contracts/src/Upgrade.sol new file mode 100644 index 0000000000..bee96074a0 --- /dev/null +++ b/contracts/src/Upgrade.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pragma solidity 0.8.23; + +import {ERC1967} from "./utils/ERC1967.sol"; +import {Call} from "./utils/Call.sol"; +import {Address} from "./utils/Address.sol"; +import {IInitializable} from "./interfaces/IInitializable.sol"; +import {IUpgradable} from "./interfaces/IUpgradable.sol"; + +/// @dev Upgrades implementation contract +library Upgrade { + using Address for address; + + function upgrade(address impl, bytes32 implCodeHash, bytes memory initializerParams) internal { + // Verify that the implementation is actually a contract + if (!impl.isContract()) { + revert IUpgradable.InvalidContract(); + } + + // As a sanity check, ensure that the codehash of implementation contract + // matches the codehash in the upgrade proposal + if (impl.codehash != implCodeHash) { + revert IUpgradable.InvalidCodeHash(); + } + + // Update the proxy with the address of the new implementation + ERC1967.store(impl); + + // Call the initializer + (bool success, bytes memory returndata) = + impl.delegatecall(abi.encodeCall(IInitializable.initialize, initializerParams)); + Call.verifyResult(success, returndata); + + emit IUpgradable.Upgraded(impl); + } +} diff --git a/contracts/src/interfaces/IGateway.sol b/contracts/src/interfaces/IGateway.sol index 14dca9ac03..aa7b0185f9 100644 --- a/contracts/src/interfaces/IGateway.sol +++ b/contracts/src/interfaces/IGateway.sol @@ -26,9 +26,6 @@ interface IGateway { // Emitted when a channel has been updated event ChannelUpdated(ChannelID indexed channelID); - // Emitted when the gateway is upgraded - event Upgraded(address indexed implementation); - // Emitted when the operating mode is changed event OperatingModeChanged(OperatingMode mode); diff --git a/contracts/src/interfaces/IShell.sol b/contracts/src/interfaces/IShell.sol new file mode 100644 index 0000000000..6811953848 --- /dev/null +++ b/contracts/src/interfaces/IShell.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pragma solidity 0.8.23; + +interface IShell { + // Upgrade gateway shell to a new implementation + function upgrade(address impl, bytes32 implCodeHash, bytes calldata initializerParams) external; +} diff --git a/contracts/src/interfaces/IUpgradable.sol b/contracts/src/interfaces/IUpgradable.sol new file mode 100644 index 0000000000..3574e5c5e3 --- /dev/null +++ b/contracts/src/interfaces/IUpgradable.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pragma solidity 0.8.23; + +interface IUpgradable { + // The new implementation address is a not a contract + error InvalidContract(); + // The supplied codehash does not match the new implementation codehash + error InvalidCodeHash(); + + // The implementation contract was upgraded + event Upgraded(address indexed implementation); +} diff --git a/contracts/src/upgrades/rococo/GatewayV2.sol b/contracts/src/upgrades/rococo/GatewayV2.sol index 3918e3d790..6fca76be5d 100644 --- a/contracts/src/upgrades/rococo/GatewayV2.sol +++ b/contracts/src/upgrades/rococo/GatewayV2.sol @@ -9,12 +9,23 @@ import {PricingStorage} from "../../storage/PricingStorage.sol"; contract GatewayV2 is Gateway { constructor( + address recoveryOperator, address beefyClient, address agentExecutor, ParaID bridgeHubParaID, bytes32 bridgeHubAgentID, - uint8 foreignTokenDecimals - ) Gateway(beefyClient, agentExecutor, bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals) {} + uint8 foreignTokenDecimals, + uint128 destinationMaxTransferFee + ) + Gateway( + beefyClient, + agentExecutor, + bridgeHubParaID, + bridgeHubAgentID, + foreignTokenDecimals, + destinationMaxTransferFee + ) + {} function initialize(bytes memory data) external override { // Prevent initialization of storage in implementation contract @@ -24,10 +35,6 @@ contract GatewayV2 is Gateway { PricingStorage.Layout storage pricing = PricingStorage.layout(); - if (pricing.multiplier != convert(0)) { - revert AlreadyInitialized(); - } - pricing.multiplier = abi.decode(data, (UD60x18)); } } diff --git a/contracts/test/Gateway.t.sol b/contracts/test/Gateway.t.sol index 2e1846f8dc..f6f4d4e563 100644 --- a/contracts/test/Gateway.t.sol +++ b/contracts/test/Gateway.t.sol @@ -9,6 +9,7 @@ import {BeefyClient} from "../src/BeefyClient.sol"; import {IGateway} from "../src/interfaces/IGateway.sol"; import {IInitializable} from "../src/interfaces/IInitializable.sol"; +import {IUpgradable} from "../src/interfaces/IUpgradable.sol"; import {Gateway} from "../src/Gateway.sol"; import {GatewayMock, GatewayV2} from "./mocks/GatewayMock.sol"; @@ -19,6 +20,8 @@ import {Agent} from "../src/Agent.sol"; import {Verification} from "../src/Verification.sol"; import {Assets} from "../src/Assets.sol"; import {SubstrateTypes} from "./../src/SubstrateTypes.sol"; +import {MultiAddress} from "../src/MultiAddress.sol"; +import {Channel, InboundMessage, OperatingMode, ParaID, Command, ChannelID, MultiAddress} from "../src/Types.sol"; import {NativeTransferFailed} from "../src/utils/SafeTransfer.sol"; import {PricingStorage} from "../src/storage/PricingStorage.sol"; @@ -48,7 +51,6 @@ import { } from "../src/Types.sol"; import {WETH9} from "canonical-weth/WETH9.sol"; -import "./mocks/GatewayUpgradeMock.sol"; import {UD60x18, ud60x18, convert} from "prb/math/src/UD60x18.sol"; contract GatewayTest is Test { @@ -86,6 +88,7 @@ contract GatewayTest is Test { uint128 public registerTokenFee = 0; uint128 public sendTokenFee = 1e10; uint128 public createTokenFee = 1e10; + uint128 public maxDestinationFee = 1e11; MultiAddress public recipientAddress32; MultiAddress public recipientAddress20; @@ -99,8 +102,9 @@ contract GatewayTest is Test { function setUp() public { AgentExecutor executor = new AgentExecutor(); - gatewayLogic = - new GatewayMock(address(0), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals); + gatewayLogic = new GatewayMock( + address(0), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals, maxDestinationFee + ); Gateway.Config memory config = Gateway.Config({ mode: OperatingMode.Normal, deliveryCost: outboundFee, @@ -490,91 +494,14 @@ contract GatewayTest is Test { // Expect the gateway to emit `Upgraded` vm.expectEmit(true, false, false, false); - emit IGateway.Upgraded(address(newLogic)); + emit IUpgradable.Upgraded(address(newLogic)); GatewayMock(address(gateway)).upgradePublic(abi.encode(params)); - // Verify that the GatewayV2.setup was called + // Verify that the GatewayV2.initialize was called assertEq(GatewayV2(address(gateway)).getValue(), 42); } - function testUpgradeInitializerRunsOnlyOnce() public { - // Upgrade to this current logic contract - AgentExecutor executor = new AgentExecutor(); - GatewayMock currentLogic = - new GatewayMock(address(0), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals); - - Gateway.Config memory config = Gateway.Config({ - mode: OperatingMode.Normal, - deliveryCost: outboundFee, - registerTokenFee: registerTokenFee, - assetHubParaID: assetHubParaID, - assetHubAgentID: assetHubAgentID, - assetHubCreateAssetFee: createTokenFee, - assetHubReserveTransferFee: sendTokenFee, - exchangeRate: exchangeRate, - multiplier: multiplier - }); - - UpgradeParams memory params = UpgradeParams({ - impl: address(currentLogic), - implCodeHash: address(currentLogic).codehash, - initParams: abi.encode(config) - }); - - vm.expectRevert(Gateway.AlreadyInitialized.selector); - // Expect the gateway to emit `Upgraded` - GatewayMock(address(gateway)).upgradePublic(abi.encode(params)); - } - - function testUpgradeSkipsInitializerIfNoneProvided() public { - bytes32 agentID = keccak256("123"); - - testSetPricingParameters(); - uint256 fee = IGateway(address(gateway)).quoteRegisterTokenFee(); - assertEq(fee, 20000000000000001); - - testCreateAgent(); - assertNotEq(GatewayMock(address(gateway)).agentOf(agentID), address(0)); - - // Upgrade to this current logic contract - AgentExecutor executor = new AgentExecutor(); - GatewayMock currentLogic = - new GatewayMock(address(0), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals); - - bytes memory initParams; // empty - UpgradeParams memory params = UpgradeParams({ - impl: address(currentLogic), - implCodeHash: address(currentLogic).codehash, - initParams: initParams - }); - - // Expect the gateway to emit `Upgraded` - GatewayMock(address(gateway)).upgradePublic(abi.encode(params)); - - // Verify that storage was not overwritten - fee = IGateway(address(gateway)).quoteRegisterTokenFee(); - assertEq(fee, 20000000000000001); - assertNotEq(GatewayMock(address(gateway)).agentOf(agentID), address(0)); - } - - function testUpgradeGatewayMock() public { - GatewayUpgradeMock newLogic = new GatewayUpgradeMock(); - uint256 d0 = 99; - uint256 d1 = 66; - bytes memory initParams = abi.encode(d0, d1); - console.logBytes(initParams); - - UpgradeParams memory params = - UpgradeParams({impl: address(newLogic), implCodeHash: address(newLogic).codehash, initParams: initParams}); - - // Expect the gateway to emit `Initialized` - vm.expectEmit(true, false, false, true); - emit GatewayUpgradeMock.Initialized(d0, d1); - - GatewayMock(address(gateway)).upgradePublic(abi.encode(params)); - } - function testUpgradeFailOnInitializationFailure() public { GatewayV2 newLogic = new GatewayV2(); @@ -594,7 +521,7 @@ contract GatewayTest is Test { UpgradeParams memory params = UpgradeParams({impl: address(newLogic), implCodeHash: bytes32(0), initParams: abi.encode(42)}); - vm.expectRevert(Gateway.InvalidCodeHash.selector); + vm.expectRevert(IUpgradable.InvalidCodeHash.selector); GatewayMock(address(gateway)).upgradePublic(abi.encode(params)); } @@ -871,7 +798,7 @@ contract GatewayTest is Test { SetTokenTransferFeesParams({ assetHubCreateAssetFee: createTokenFee * 2, registerTokenFee: registerTokenFee, - assetHubReserveTransferFee: sendTokenFee + assetHubReserveTransferFee: sendTokenFee * 3 }) ) ); @@ -906,7 +833,7 @@ contract GatewayTest is Test { assertEq(fee, 20000000000000001); } - function testSendTokenToForeignDestWithInvalidFee() public { + function testSendTokenWithZeroDestinationFee() public { // Let gateway lock up to 1 tokens token.approve(address(gateway), 1); @@ -916,13 +843,32 @@ contract GatewayTest is Test { // register token first uint256 fee = IGateway(address(gateway)).quoteRegisterTokenFee(); IGateway(address(gateway)).registerToken{value: fee}(address(token)); - fee = IGateway(address(gateway)).quoteSendTokenFee(address(token), destPara, 0); vm.expectRevert(Assets.InvalidDestinationFee.selector); IGateway(address(gateway)).sendToken{value: fee}(address(token), destPara, recipientAddress32, 0, 1); } + function testSendTokenWithLargeDestinationFee() public { + // Let gateway lock up to 1 tokens + token.approve(address(gateway), 1); + + // Multilocation for recipient + ParaID destPara = ParaID.wrap(2043); + + // register token first + uint256 fee = IGateway(address(gateway)).quoteRegisterTokenFee(); + IGateway(address(gateway)).registerToken{value: fee}(address(token)); + + vm.expectRevert(Assets.InvalidDestinationFee.selector); + IGateway(address(gateway)).quoteSendTokenFee(address(token), destPara, maxDestinationFee + 1); + + vm.expectRevert(Assets.InvalidDestinationFee.selector); + IGateway(address(gateway)).sendToken{value: fee}( + address(token), destPara, recipientAddress32, maxDestinationFee + 1, 1 + ); + } + /** * Transact */ diff --git a/contracts/test/Shell.t.sol b/contracts/test/Shell.t.sol new file mode 100644 index 0000000000..b399ae8acc --- /dev/null +++ b/contracts/test/Shell.t.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.23; + +import {Test} from "forge-std/Test.sol"; +import {Strings} from "openzeppelin/utils/Strings.sol"; +import {console} from "forge-std/console.sol"; + +import {IGateway} from "../src/interfaces/IGateway.sol"; +import {IInitializable} from "../src/interfaces/IInitializable.sol"; +import {IUpgradable} from "../src/interfaces/IUpgradable.sol"; +import {IShell} from "../src/interfaces/IShell.sol"; +import {Gateway} from "../src/Gateway.sol"; +import {GatewayProxy} from "../src/GatewayProxy.sol"; +import {Shell} from "../src/Shell.sol"; +import {Upgrade} from "../src/Upgrade.sol"; +import {GatewayMock, GatewayV2} from "./mocks/GatewayMock.sol"; + +contract ShellTest is Test { + GatewayProxy public gateway; + Shell public shell; + + function setUp() public { + shell = new Shell(address(this)); + gateway = new GatewayProxy(address(shell), bytes("")); + } + + function testUpgradeShell() public { + // Upgrade to this new logic contract + address newLogic = address(new GatewayV2()); + bytes memory initParams = abi.encode(42); + + // Expect the gateway to emit `Upgrade.Upgraded` + vm.expectEmit(true, false, false, true); + emit IUpgradable.Upgraded(newLogic); + + // Perform the upgrade + IShell(address(gateway)).upgrade(newLogic, newLogic.codehash, initParams); + + // Verify that the upgrade occured + + // Execute code only available in the new impl + assertEq(GatewayV2(address(gateway)).getValue(), 42); + + // Should no longer be able to upgrade via trusted operator + vm.expectRevert(); + IShell(address(gateway)).upgrade(newLogic, newLogic.codehash, initParams); + } +} diff --git a/contracts/test/mocks/GatewayMock.sol b/contracts/test/mocks/GatewayMock.sol index b1014811be..145e65874d 100644 --- a/contracts/test/mocks/GatewayMock.sol +++ b/contracts/test/mocks/GatewayMock.sol @@ -16,8 +16,11 @@ contract GatewayMock is Gateway { address agentExecutor, ParaID bridgeHubParaID, bytes32 bridgeHubHubAgentID, - uint8 foreignTokenDecimals - ) Gateway(beefyClient, agentExecutor, bridgeHubParaID, bridgeHubHubAgentID, foreignTokenDecimals) {} + uint8 foreignTokenDecimals, + uint128 maxDestinationFee + ) + Gateway(beefyClient, agentExecutor, bridgeHubParaID, bridgeHubHubAgentID, foreignTokenDecimals, maxDestinationFee) + {} function agentExecutePublic(bytes calldata params) external { this.agentExecute(params); @@ -89,8 +92,10 @@ library AdditionalStorage { } } +import {IInitializable} from "../../src/interfaces/IInitializable.sol"; + // Used to test upgrades. -contract GatewayV2 { +contract GatewayV2 is IInitializable { // Reinitialize gateway with some additional storage fields function initialize(bytes memory params) external { AdditionalStorage.Layout storage $ = AdditionalStorage.layout(); diff --git a/contracts/test/mocks/GatewayUpgradeMock.sol b/contracts/test/mocks/GatewayUpgradeMock.sol deleted file mode 100644 index d9fba2ef8c..0000000000 --- a/contracts/test/mocks/GatewayUpgradeMock.sol +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -pragma solidity 0.8.23; - -import { - Channel, - InboundMessage, - OperatingMode, - ParaID, - Command, - ChannelID, - MultiAddress, - OriginKind, - Weight -} from "../../src/Types.sol"; -import {IGateway} from "../../src/interfaces/IGateway.sol"; -import {IInitializable} from "../../src/interfaces/IInitializable.sol"; -import {Verification} from "../../src/Verification.sol"; -import {UD60x18, convert} from "prb/math/src/UD60x18.sol"; - -contract GatewayUpgradeMock is IGateway, IInitializable { - /** - * Getters - */ - function operatingMode() external pure returns (OperatingMode) { - return OperatingMode.Normal; - } - - function channelOperatingModeOf(ChannelID) external pure returns (OperatingMode) { - return OperatingMode.Normal; - } - - function channelNoncesOf(ChannelID) external pure returns (uint64, uint64) { - return (0, 0); - } - - function agentOf(bytes32) external pure returns (address) { - return address(0); - } - - function implementation() external pure returns (address) { - return address(0); - } - - function isTokenRegistered(address) external pure returns (bool) { - return true; - } - - function submitV1(InboundMessage calldata, bytes32[] calldata, Verification.Proof calldata) external {} - - function quoteRegisterTokenFee() external pure returns (uint256) { - return 1; - } - - function registerToken(address) external payable {} - - function quoteSendTokenFee(address, ParaID, uint128) external pure returns (uint256) { - return 1; - } - - function sendToken(address, ParaID, MultiAddress calldata, uint128, uint128) external payable {} - - event Initialized(uint256 d0, uint256 d1); - - function initialize(bytes memory data) external { - // Just decode and exit - (uint256 d0, uint256 d1) = abi.decode(data, (uint256, uint256)); - emit Initialized(d0, d1); - } - - function pricingParameters() external pure returns (UD60x18, uint128) { - return (convert(0), uint128(0)); - } - - function sendCall( - ParaID destinationChain, - OriginKind originKind, - uint128 destinationFee, - Weight calldata weightAtMost, - bytes calldata call - ) external payable {} - - function quoteSendCallFee(uint128) external pure returns (uint256) { - return 1; - } -} diff --git a/control/.gitignore b/control/.gitignore index 5bd3e67032..9272c3cf0f 100644 --- a/control/.gitignore +++ b/control/.gitignore @@ -10,3 +10,12 @@ # The cache for chain data in container .local + +/chain-spec-generator +/polkadot +/polkadot-execute-worker +/polkadot-parachain +/polkadot-prepare-worker +/initial-checkpoint.json +db.sqlite +db.sqlite-* diff --git a/control/Cargo.lock b/control/Cargo.lock index bc6727c964..951c8ba9cc 100644 --- a/control/Cargo.lock +++ b/control/Cargo.lock @@ -195,6 +195,20 @@ version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +[[package]] +name = "aquamarine" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "ark-bls12-377" version = "0.4.0" @@ -417,6 +431,28 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "asset-hub-polkadot-runtime" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic 24.0.0", + "subxt 0.35.1", +] + +[[package]] +name = "asset-hub-rococo-runtime" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic 24.0.0", + "subxt 0.35.1", +] + [[package]] name = "async-channel" version = "2.2.0" @@ -656,7 +692,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.11.0", "rand", "rand_core 0.6.4", "serde", @@ -678,12 +714,28 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -805,6 +857,30 @@ dependencies = [ "serde", ] +[[package]] +name = "bounded-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "bridge-hub-polkadot-runtime" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "snowbridge-beacon-primitives", + "sp-arithmetic 24.0.0", + "subxt 0.35.1", +] + [[package]] name = "bridge-hub-rococo-runtime" version = "0.1.0" @@ -812,7 +888,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "subxt", + "snowbridge-beacon-primitives", + "sp-arithmetic 24.0.0", + "subxt 0.35.1", ] [[package]] @@ -860,6 +938,15 @@ version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3286b845d0fccbdd15af433f61c5970e711987036cb468f437ff6badd70f4e24" +[[package]] +name = "cfg-expr" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -979,6 +1066,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -1388,6 +1495,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -1466,6 +1574,7 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", + "serdect", "subtle", "zeroize", ] @@ -1492,6 +1601,47 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "ethabi-decode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d398648d65820a727d6a81e58b962f874473396a047e4c30bafe3240953417" +dependencies = [ + "ethereum-types", + "tiny-keccak", +] + +[[package]] +name = "ethbloom" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "primitive-types", + "scale-info", + "uint", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -1648,6 +1798,113 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-support" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40bde5b74ac70a1c9fe4f846220ea10e78b81b0ffcdb567d16d28472bc332f95" +dependencies = [ + "aquamarine", + "array-bytes", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata 16.0.0", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "smallvec", + "sp-api", + "sp-arithmetic 25.0.0", + "sp-core 30.0.0", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder", + "sp-inherents", + "sp-io 32.0.0", + "sp-metadata-ir", + "sp-runtime 33.0.0", + "sp-staking", + "sp-state-machine 0.37.0", + "sp-std", + "sp-tracing", + "sp-weights 29.0.0", + "static_assertions", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bf871c6655636a40a74d06f7f1bf69813f8037ad269704ae35b1c56c42ec" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "expander", + "frame-support-procedural-tools", + "itertools 0.10.5", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing", + "syn 2.0.50", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "frame-system" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c302f711acf3196b4bf2b4629a07a2ac6e44cd1782434ec88b85d59adfb1204d" +dependencies = [ + "cfg-if", + "docify", + "frame-support", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 30.0.0", + "sp-io 32.0.0", + "sp-runtime 33.0.0", + "sp-std", + "sp-version", + "sp-weights 29.0.0", +] + [[package]] name = "fs-err" version = "2.11.0" @@ -1860,6 +2117,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "handlebars" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "hash-db" version = "0.16.0" @@ -1922,6 +2193,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" + [[package]] name = "hex-literal" version = "0.4.1" @@ -2090,6 +2367,15 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + [[package]] name = "impl-serde" version = "0.4.0" @@ -2110,6 +2396,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -2214,10 +2519,22 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2" dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-http-client", - "jsonrpsee-types", + "jsonrpsee-client-transport 0.21.0", + "jsonrpsee-core 0.21.0", + "jsonrpsee-http-client 0.21.0", + "jsonrpsee-types 0.21.0", +] + +[[package]] +name = "jsonrpsee" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cdbb7cb6f3ba28f5b212dd250ab4483105efc3e381f5c8bb90340f14f0a2cc3" +dependencies = [ + "jsonrpsee-client-transport 0.22.3", + "jsonrpsee-core 0.22.3", + "jsonrpsee-http-client 0.22.3", + "jsonrpsee-types 0.22.3", ] [[package]] @@ -2228,7 +2545,28 @@ checksum = "3f9f9ed46590a8d5681975f126e22531698211b926129a40a2db47cbca429220" dependencies = [ "futures-util", "http", - "jsonrpsee-core", + "jsonrpsee-core 0.21.0", + "pin-project", + "rustls-native-certs 0.7.0", + "rustls-pki-types", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.25.0", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ab2e14e727d2faf388c99d9ca5210566ed3b044f07d92c29c3611718d178380" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core 0.22.3", "pin-project", "rustls-native-certs 0.7.0", "rustls-pki-types", @@ -2254,7 +2592,31 @@ dependencies = [ "futures-timer", "futures-util", "hyper", - "jsonrpsee-types", + "jsonrpsee-types 0.21.0", + "pin-project", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71962a1c49af43adf81d337e4ebc93f3c915faf6eccaa14d74e255107dfd7723" +dependencies = [ + "anyhow", + "async-lock 3.3.0", + "async-trait", + "beef", + "futures-timer", + "futures-util", + "hyper", + "jsonrpsee-types 0.22.3", "pin-project", "rustc-hash", "serde", @@ -2274,8 +2636,28 @@ dependencies = [ "async-trait", "hyper", "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.21.0", + "jsonrpsee-types 0.21.0", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c13987da51270bda2c1c9b40c19be0fe9b225c7a0553963d8f17e683a50ce84" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls", + "jsonrpsee-core 0.22.3", + "jsonrpsee-types 0.22.3", "serde", "serde_json", "thiserror", @@ -2298,6 +2680,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "jsonrpsee-types" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e53c72de6cd2ad6ac1aa6e848206ef8b736f92ed02354959130373dfa5b3cbd" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "k256" version = "0.13.3" @@ -2308,6 +2703,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", "signature", ] @@ -2443,6 +2839,54 @@ dependencies = [ "libc", ] +[[package]] +name = "macro_magic" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "macro_magic_core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "macro_magic_macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.50", +] + [[package]] name = "matchers" version = "0.0.1" @@ -2670,6 +3114,25 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "parity-bytes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b56e3a2420138bdb970f84dfb9c774aea80fa0e7371549eedec0d80c209c67" + [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -2697,6 +3160,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + [[package]] name = "parking" version = "2.2.0" @@ -2726,6 +3195,17 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -2748,6 +3228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "password-hash", ] [[package]] @@ -2758,15 +3239,49 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.7" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", "ucd-trie", ] +[[package]] +name = "pest_derive" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "pest_meta" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.8", +] + [[package]] name = "pin-project" version = "1.1.4" @@ -2826,6 +3341,90 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +[[package]] +name = "polkadot-runtime" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "subxt 0.34.0", +] + +[[package]] +name = "polkavm-common" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" + +[[package]] +name = "polkavm-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" + +[[package]] +name = "polkavm-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" +dependencies = [ + "polkavm-derive-impl-macro 0.8.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +dependencies = [ + "polkavm-derive-impl-macro 0.9.0", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" +dependencies = [ + "polkavm-common 0.8.0", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +dependencies = [ + "polkavm-common 0.9.0", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +dependencies = [ + "polkavm-derive-impl 0.8.0", + "syn 2.0.50", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +dependencies = [ + "polkavm-derive-impl 0.9.0", + "syn 2.0.50", +] + [[package]] name = "polling" version = "3.5.0" @@ -2865,6 +3464,7 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", + "impl-rlp", "impl-serde", "scale-info", "uint", @@ -2922,11 +3522,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-warning" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -3141,7 +3752,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "subxt", + "subxt 0.34.0", ] [[package]] @@ -3389,6 +4000,18 @@ dependencies = [ "serde", ] +[[package]] +name = "scale-bits" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "662d10dcd57b1c2a3c41c9cf68f71fb09747ada1ea932ad961aca7e2ca28315f" +dependencies = [ + "parity-scale-codec", + "scale-info", + "scale-type-resolver", + "serde", +] + [[package]] name = "scale-decode" version = "0.10.0" @@ -3398,12 +4021,27 @@ dependencies = [ "derive_more", "parity-scale-codec", "primitive-types", - "scale-bits", - "scale-decode-derive", + "scale-bits 0.4.0", + "scale-decode-derive 0.10.0", "scale-info", "smallvec", ] +[[package]] +name = "scale-decode" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc79ba56a1c742f5aeeed1f1801f3edf51f7e818f0a54582cac6f131364ea7b" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits 0.5.0", + "scale-decode-derive 0.11.1", + "scale-type-resolver", + "smallvec", +] + [[package]] name = "scale-decode-derive" version = "0.10.0" @@ -3417,6 +4055,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-decode-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5398fdb3c7bea3cb419bac4983aadacae93fe1a7b5f693f4ebd98c3821aad7a5" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-encode" version = "0.5.0" @@ -3426,12 +4076,27 @@ dependencies = [ "derive_more", "parity-scale-codec", "primitive-types", - "scale-bits", - "scale-encode-derive", + "scale-bits 0.4.0", + "scale-encode-derive 0.5.0", "scale-info", "smallvec", ] +[[package]] +name = "scale-encode" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits 0.5.0", + "scale-encode-derive 0.6.0", + "scale-type-resolver", + "smallvec", +] + [[package]] name = "scale-encode-derive" version = "0.5.0" @@ -3445,11 +4110,24 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-encode-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a304e1af7cdfbe7a24e08b012721456cc8cecdedadc14b3d10513eada63233c" +dependencies = [ + "darling 0.14.4", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "788745a868b0e751750388f4e6546eb921ef714a4317fa6954f7cde114eb2eb7" dependencies = [ "bitvec", "cfg-if", @@ -3461,9 +4139,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "7dc2f4e8bc344b9fc3d5f74f72c2e55bfc38d28dc2ebc69c194a3df424e4d9ac" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -3471,6 +4149,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-type-resolver" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10b800069bfd43374e0f96f653e0d46882a2cb16d6d961ac43bea80f26c76843" +dependencies = [ + "scale-info", + "smallvec", +] + [[package]] name = "scale-typegen" version = "0.1.1" @@ -3484,6 +4172,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "scale-typegen" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d470fa75e71b12b3244a4113adc4bc49891f3daba2054703cacd06256066397e" +dependencies = [ + "proc-macro2", + "quote", + "scale-info", + "syn 2.0.50", + "thiserror", +] + [[package]] name = "scale-value" version = "0.13.0" @@ -3496,17 +4197,38 @@ dependencies = [ "either", "frame-metadata 15.1.0", "parity-scale-codec", - "scale-bits", - "scale-decode", - "scale-encode", + "scale-bits 0.4.0", + "scale-decode 0.10.0", + "scale-encode 0.5.0", "scale-info", "serde", "yap", ] [[package]] -name = "schannel" -version = "0.1.23" +name = "scale-value" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07ccfee963104335c971aaf8b7b0e749be8569116322df23f1f75c4ca9e4a28" +dependencies = [ + "base58", + "blake2", + "derive_more", + "either", + "frame-metadata 15.1.0", + "parity-scale-codec", + "scale-bits 0.5.0", + "scale-decode 0.11.1", + "scale-encode 0.6.0", + "scale-info", + "scale-type-resolver", + "serde", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ @@ -3585,6 +4307,7 @@ dependencies = [ "der", "generic-array 0.14.7", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -3672,6 +4395,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd31f59f6fe2b0c055371bb2f16d7f0aa7d8881676c04a55b1596d1a17cd10a4" +dependencies = [ + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.14" @@ -3712,6 +4444,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha-1" version = "0.9.8" @@ -3944,22 +4686,103 @@ dependencies = [ "zeroize", ] +[[package]] +name = "snowbridge-amcl" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "snowbridge-beacon-primitives" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c35d4d8b5be969d0f824c6aa8380289edf0bec2c45ccef9f758a4d7a7dca96ea" +dependencies = [ + "byte-slice-cast", + "frame-support", + "frame-system", + "hex", + "parity-scale-codec", + "rlp", + "scale-info", + "serde", + "snowbridge-ethereum", + "snowbridge-milagro-bls", + "sp-core 30.0.0", + "sp-io 32.0.0", + "sp-runtime 33.0.0", + "sp-std", + "ssz_rs", + "ssz_rs_derive", + "static_assertions", +] + +[[package]] +name = "snowbridge-ethereum" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4000b70f42c9adc0247de3893aee803cbf37e9e5f13a4c18a28a86872f648a" +dependencies = [ + "ethabi-decode", + "ethbloom", + "ethereum-types", + "hex-literal", + "parity-bytes", + "parity-scale-codec", + "rlp", + "rustc-hex", + "scale-info", + "serde", + "serde-big-array", + "sp-core 30.0.0", + "sp-io 32.0.0", + "sp-runtime 33.0.0", + "sp-std", +] + +[[package]] +name = "snowbridge-milagro-bls" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "026aa8638f690a53e3f7676024b9e913b1cab0111d1b7b92669d40a188f9d7e6" +dependencies = [ + "hex", + "lazy_static", + "parity-scale-codec", + "rand", + "scale-info", + "snowbridge-amcl", + "zeroize", +] + [[package]] name = "snowbridge-preimage" version = "0.1.0" dependencies = [ "alloy-primitives", + "asset-hub-polkadot-runtime", + "asset-hub-rococo-runtime", + "bridge-hub-polkadot-runtime", "bridge-hub-rococo-runtime", "clap", "futures", + "handlebars", "hex", "hex-literal", "parity-scale-codec", + "polkadot-runtime", "rococo-runtime", "scale-info", "serde", + "serde_json", + "snowbridge-beacon-primitives", "sp-arithmetic 24.0.0", - "subxt", + "sp-crypto-hashing", + "subxt 0.35.1", "tokio", ] @@ -3988,6 +4811,44 @@ dependencies = [ "sha-1", ] +[[package]] +name = "sp-api" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298331cb47a948244f6fb4921b5cbeece267d72139fb90760993b6ec37b2212c" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core 30.0.0", + "sp-externalities 0.27.0", + "sp-metadata-ir", + "sp-runtime 33.0.0", + "sp-runtime-interface 26.0.0", + "sp-state-machine 0.37.0", + "sp-std", + "sp-trie 31.0.0", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18cfbb3ae0216e842dfb805ea8e896e85b07a7c34d432a6c7b7d770924431ed2" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "sp-application-crypto" version = "30.0.0" @@ -3997,8 +4858,36 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-std", +] + +[[package]] +name = "sp-application-crypto" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b4b7b12922cb90cf8dff0cab14087ba0ca25c1f04ba060c7294ce42c78d89ab" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 30.0.0", + "sp-io 32.0.0", + "sp-std", +] + +[[package]] +name = "sp-application-crypto" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13ca6121c22c8bd3d1dce1f05c479101fd0d7b159bef2a3e8c834138d839c75c" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 31.0.0", + "sp-io 33.0.0", "sp-std", ] @@ -4032,6 +4921,21 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "sp-arithmetic" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + [[package]] name = "sp-core" version = "28.0.0" @@ -4042,7 +4946,7 @@ dependencies = [ "bip39", "bitflags 1.3.2", "blake2", - "bounded-collections", + "bounded-collections 0.1.9", "bs58", "dyn-clonable", "ed25519-zebra 3.1.0", @@ -4066,12 +4970,105 @@ dependencies = [ "serde", "sp-core-hashing", "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", + "sp-externalities 0.25.0", + "sp-runtime-interface 24.0.0", + "sp-std", + "sp-storage 19.0.0", + "ss58-registry", + "substrate-bip39 0.4.5", + "thiserror", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "586e0d5185e4545f465fc9a04fb9c4572d3e294137312496db2b67b0bb579e1f" +dependencies = [ + "array-bytes", + "bip39", + "bitflags 1.3.2", + "blake2", + "bounded-collections 0.2.0", + "bs58", + "dyn-clonable", + "ed25519-zebra 3.1.0", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.10.5", + "libsecp256k1", + "log", + "merlin 3.0.0", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand", + "scale-info", + "schnorrkel 0.11.4", + "secp256k1", + "secrecy", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities 0.27.0", + "sp-runtime-interface 26.0.0", "sp-std", - "sp-storage", + "sp-storage 20.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.4.5", + "thiserror", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d7a0fd8f16dcc3761198fc83be12872f823b37b749bc72a3a6a1f702509366" +dependencies = [ + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections 0.2.0", + "bs58", + "dyn-clonable", + "ed25519-zebra 3.1.0", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.10.5", + "k256", + "libsecp256k1", + "log", + "merlin 3.0.0", + "parity-bip39", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand", + "scale-info", + "schnorrkel 0.11.4", + "secp256k1", + "secrecy", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities 0.27.0", + "sp-runtime-interface 26.0.0", + "sp-std", + "sp-storage 20.0.0", + "ss58-registry", + "substrate-bip39 0.5.0", "thiserror", "tracing", "w3f-bls", @@ -4092,6 +5089,31 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3", + "twox-hash", +] + +[[package]] +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" +dependencies = [ + "quote", + "sp-crypto-hashing", + "syn 2.0.50", +] + [[package]] name = "sp-debug-derive" version = "14.0.0" @@ -4112,7 +5134,46 @@ dependencies = [ "environmental", "parity-scale-codec", "sp-std", - "sp-storage", + "sp-storage 19.0.0", +] + +[[package]] +name = "sp-externalities" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage 20.0.0", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a862db099e8a799417b63ea79c90079811cdf68fcf3013d81cdceeddcec8f142" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime 33.0.0", + "sp-std", +] + +[[package]] +name = "sp-inherents" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42eb3c88572c7c80e7ecb6365601a490350b09d11000fcc7839efd304e172177" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime 33.0.0", + "sp-std", + "thiserror", ] [[package]] @@ -4128,14 +5189,67 @@ dependencies = [ "parity-scale-codec", "rustversion", "secp256k1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-keystore 0.34.0", + "sp-runtime-interface 24.0.0", + "sp-state-machine 0.35.0", + "sp-std", + "sp-tracing", + "sp-trie 29.0.0", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" +dependencies = [ + "bytes", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "sp-core 30.0.0", + "sp-crypto-hashing", + "sp-externalities 0.27.0", + "sp-keystore 0.36.0", + "sp-runtime-interface 26.0.0", + "sp-state-machine 0.37.0", "sp-std", "sp-tracing", - "sp-trie", + "sp-trie 31.0.0", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e09bba780b55bd9e67979cd8f654a31e4a6cf45426ff371394a65953d2177f2" +dependencies = [ + "bytes", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive 0.9.1", + "rustversion", + "secp256k1", + "sp-core 31.0.0", + "sp-crypto-hashing", + "sp-externalities 0.27.0", + "sp-keystore 0.37.0", + "sp-runtime-interface 26.0.0", + "sp-state-machine 0.38.0", + "sp-std", + "sp-tracing", + "sp-trie 32.0.0", "tracing", "tracing-core", ] @@ -4148,11 +5262,47 @@ checksum = "96806a28a62ed9ddecd0b28857b1344d029390f7c5c42a2ff9199cbf5638635c" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core", - "sp-externalities", + "sp-core 28.0.0", + "sp-externalities 0.25.0", "thiserror", ] +[[package]] +name = "sp-keystore" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd4bf9e5fa486416c92c2bb497b7ce2c43eac80cbdc407ffe2d34b365694ac29" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core 30.0.0", + "sp-externalities 0.27.0", +] + +[[package]] +name = "sp-keystore" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdbab8b61bd61d5f8625a0c75753b5d5a23be55d3445419acd42caf59cf6236b" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core 31.0.0", + "sp-externalities 0.27.0", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" +dependencies = [ + "frame-metadata 16.0.0", + "parity-scale-codec", + "scale-info", + "sp-std", +] + [[package]] name = "sp-panic-handler" version = "13.0.0" @@ -4181,52 +5331,195 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto", + "sp-application-crypto 30.0.0", "sp-arithmetic 23.0.0", - "sp-core", - "sp-io", + "sp-core 28.0.0", + "sp-io 30.0.0", "sp-std", - "sp-weights", + "sp-weights 27.0.0", +] + +[[package]] +name = "sp-runtime" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b28fcf8f53d917e420e783dd27d06fd276f55160301c5bc977cc5898c4130f6f" +dependencies = [ + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto 32.0.0", + "sp-arithmetic 25.0.0", + "sp-core 30.0.0", + "sp-io 32.0.0", + "sp-std", + "sp-weights 29.0.0", +] + +[[package]] +name = "sp-runtime" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3cb126971e7db2f0fcf8053dce740684c438c7180cfca1959598230f342c58" +dependencies = [ + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto 33.0.0", + "sp-arithmetic 25.0.0", + "sp-core 31.0.0", + "sp-io 33.0.0", + "sp-std", + "sp-weights 30.0.0", ] [[package]] name = "sp-runtime-interface" version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66b66d8cec3d785fa6289336c1d9cbd4305d5d84f7134378c4d79ed7983e6fb" +checksum = "f66b66d8cec3d785fa6289336c1d9cbd4305d5d84f7134378c4d79ed7983e6fb" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.25.0", + "sp-runtime-interface-proc-macro 17.0.0", + "sp-std", + "sp-storage 19.0.0", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.8.0", + "primitive-types", + "sp-externalities 0.27.0", + "sp-runtime-interface-proc-macro 18.0.0", + "sp-std", + "sp-storage 20.0.0", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "sp-staking" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48b92f4f66b40cbf7cf00d7808d8eec16e25cb420a29ec4060a74c0e9f7c2938" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 30.0.0", + "sp-runtime 33.0.0", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718c779ad1d6fcc0be64c7ce030b33fa44b5c8914b3a1319ef63bb5f27fb98df" dependencies = [ - "bytes", - "impl-trait-for-tuples", + "hash-db", + "log", "parity-scale-codec", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", + "parking_lot", + "rand", + "smallvec", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-panic-handler", "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", + "sp-trie 29.0.0", + "thiserror", + "tracing", + "trie-db", ] [[package]] -name = "sp-runtime-interface-proc-macro" -version = "17.0.0" +name = "sp-state-machine" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" +checksum = "23ae47765916d342b53d07be012a71efc4c1377d875ade31340cc4fb784b9921" dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.50", + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand", + "smallvec", + "sp-core 30.0.0", + "sp-externalities 0.27.0", + "sp-panic-handler", + "sp-std", + "sp-trie 31.0.0", + "thiserror", + "tracing", + "trie-db", ] [[package]] name = "sp-state-machine" -version = "0.35.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718c779ad1d6fcc0be64c7ce030b33fa44b5c8914b3a1319ef63bb5f27fb98df" +checksum = "1eae0eac8034ba14437e772366336f579398a46d101de13dbb781ab1e35e67c5" dependencies = [ "hash-db", "log", @@ -4234,11 +5527,11 @@ dependencies = [ "parking_lot", "rand", "smallvec", - "sp-core", - "sp-externalities", + "sp-core 31.0.0", + "sp-externalities 0.27.0", "sp-panic-handler", "sp-std", - "sp-trie", + "sp-trie 32.0.0", "thiserror", "tracing", "trie-db", @@ -4264,6 +5557,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-storage" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "sp-tracing" version = "16.0.0" @@ -4293,8 +5600,58 @@ dependencies = [ "rand", "scale-info", "schnellru", - "sp-core", - "sp-externalities", + "sp-core 28.0.0", + "sp-externalities 0.25.0", + "sp-std", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" +dependencies = [ + "ahash 0.8.9", + "hash-db", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand", + "scale-info", + "schnellru", + "sp-core 30.0.0", + "sp-externalities 0.27.0", + "sp-std", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1aa91ad26c62b93d73e65f9ce7ebd04459c4bad086599348846a81988d6faa4" +dependencies = [ + "ahash 0.8.9", + "hash-db", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand", + "scale-info", + "schnellru", + "sp-core 31.0.0", + "sp-externalities 0.27.0", "sp-std", "thiserror", "tracing", @@ -4302,6 +5659,36 @@ dependencies = [ "trie-root", ] +[[package]] +name = "sp-version" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "973478ac076be7cb8e0a7968ee43cd7c46fb26e323d36020a9f3bb229e033cd2" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-crypto-hashing-proc-macro", + "sp-runtime 33.0.0", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "sp-wasm-interface" version = "20.0.0" @@ -4322,7 +5709,7 @@ version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e874bdf9dd3fd3242f5b7867a4eaedd545b02f29041a46d222a9d9d5caaaa5c" dependencies = [ - "bounded-collections", + "bounded-collections 0.1.9", "parity-scale-codec", "scale-info", "serde", @@ -4332,6 +5719,38 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-weights" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab8a9c7a1b64fa7dba38622ad1de26f0b2e595727c0e42c7b109ecb8e7120688" +dependencies = [ + "bounded-collections 0.2.0", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 25.0.0", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-weights" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9af6c661fe3066b29f9e1d258000f402ff5cc2529a9191972d214e5871d0ba87" +dependencies = [ + "bounded-collections 0.2.0", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 25.0.0", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "spin" version = "0.9.8" @@ -4363,6 +5782,29 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "ssz_rs" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057291e5631f280978fa9c8009390663ca4613359fc1318e36a8c24c392f6d1f" +dependencies = [ + "bitvec", + "num-bigint", + "sha2 0.9.9", + "ssz_rs_derive", +] + +[[package]] +name = "ssz_rs_derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f07d54c4d01a1713eb363b55ba51595da15f6f1211435b71466460da022aa140" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4400,6 +5842,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-bip39" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b564c293e6194e8b222e52436bcb99f60de72043c7f845cf6c4406db4df121" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel 0.11.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "subtle" version = "2.5.0" @@ -4422,22 +5877,60 @@ dependencies = [ "hex", "impl-serde", "instant", - "jsonrpsee", + "jsonrpsee 0.21.0", "parity-scale-codec", "primitive-types", - "scale-bits", - "scale-decode", - "scale-encode", + "scale-bits 0.4.0", + "scale-decode 0.10.0", + "scale-encode 0.5.0", "scale-info", - "scale-value", + "scale-value 0.13.0", "serde", "serde_json", - "sp-core", + "sp-core 28.0.0", "sp-core-hashing", - "sp-runtime", - "subxt-lightclient", - "subxt-macro", - "subxt-metadata", + "sp-runtime 31.0.1", + "subxt-lightclient 0.34.0", + "subxt-macro 0.34.0", + "subxt-metadata 0.34.0", + "thiserror", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "subxt" +version = "0.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5c287b336efcb9bab54020329c48d8cc6427e1c13dcc3b4ec20c793ff8a6926" +dependencies = [ + "async-trait", + "base58", + "blake2", + "derivative", + "either", + "frame-metadata 16.0.0", + "futures", + "hex", + "impl-serde", + "instant", + "jsonrpsee 0.22.3", + "parity-scale-codec", + "primitive-types", + "scale-bits 0.5.0", + "scale-decode 0.11.1", + "scale-encode 0.6.0", + "scale-info", + "scale-value 0.14.1", + "serde", + "serde_json", + "sp-core 31.0.0", + "sp-crypto-hashing", + "sp-runtime 34.0.0", + "subxt-lightclient 0.35.1", + "subxt-macro 0.35.1", + "subxt-metadata 0.35.1", "thiserror", "tokio-util", "tracing", @@ -4453,13 +5946,34 @@ dependencies = [ "frame-metadata 16.0.0", "heck", "hex", - "jsonrpsee", + "jsonrpsee 0.21.0", + "parity-scale-codec", + "proc-macro2", + "quote", + "scale-info", + "scale-typegen 0.1.1", + "subxt-metadata 0.34.0", + "syn 2.0.50", + "thiserror", + "tokio", +] + +[[package]] +name = "subxt-codegen" +version = "0.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31528ba082daea68850852ecb49e463022b47c14f8031874c73d04ce04d36d05" +dependencies = [ + "frame-metadata 16.0.0", + "heck", + "hex", + "jsonrpsee 0.22.3", "parity-scale-codec", "proc-macro2", "quote", "scale-info", - "scale-typegen", - "subxt-metadata", + "scale-typegen 0.2.1", + "subxt-metadata 0.35.1", "syn 2.0.50", "thiserror", "tokio", @@ -4482,6 +5996,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "subxt-lightclient" +version = "0.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e4dc4cf724926d89dadeb26ecba7b8c92a3cabd04f1385ea46a927ef1508b0" +dependencies = [ + "futures", + "futures-util", + "serde", + "serde_json", + "smoldot-light", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "subxt-macro" version = "0.34.0" @@ -4492,8 +6023,23 @@ dependencies = [ "parity-scale-codec", "proc-macro-error", "quote", - "scale-typegen", - "subxt-codegen", + "scale-typegen 0.1.1", + "subxt-codegen 0.34.0", + "syn 2.0.50", +] + +[[package]] +name = "subxt-macro" +version = "0.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4de9eebf532a2d28dea87e04974180842c892ca74b710cc929f3df7d3560e8" +dependencies = [ + "darling 0.20.8", + "parity-scale-codec", + "proc-macro-error", + "quote", + "scale-typegen 0.2.1", + "subxt-codegen 0.35.1", "syn 2.0.50", ] @@ -4510,6 +6056,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "subxt-metadata" +version = "0.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2ed94dbebe8a093c8990bfced142ac5377a1be8e5e2c8cfa5e0d7dce851289" +dependencies = [ + "derive_more", + "frame-metadata 16.0.0", + "hashbrown 0.14.3", + "parity-scale-codec", + "scale-info", + "sp-crypto-hashing", +] + [[package]] name = "syn" version = "1.0.109" @@ -4892,6 +6452,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + [[package]] name = "twox-hash" version = "1.6.3" diff --git a/control/Cargo.toml b/control/Cargo.toml index e11961d486..dca6bf7ed9 100644 --- a/control/Cargo.toml +++ b/control/Cargo.toml @@ -3,5 +3,9 @@ resolver = "2" members = [ "runtimes/rococo", "runtimes/bridge-hub-rococo", + "runtimes/asset-hub-rococo", + "runtimes/polkadot", + "runtimes/bridge-hub-polkadot", + "runtimes/asset-hub-polkadot", "preimage", ] diff --git a/control/README.md b/control/README.md new file mode 100644 index 0000000000..2ba7f32c32 --- /dev/null +++ b/control/README.md @@ -0,0 +1,68 @@ +# Governance tools + +Tools for generating governance proposals + +## Example: Generate bridge activation preimage + +```shell +snowbridge-preimage + --bridge-hub-api ws://localhost:8001 \ + --asset-hub-api ws://localhost:8000 \ + initialize \ + --exchange-rate-numerator 1 \ + --exchange-rate-denominator 400 \ + --multiplier-numerator 4 \ + --multiplier-denominator 3 \ + --fee-per-gas 80 \ + --local-reward 0.01 \ + --remote-reward 0.0001 \ + --checkpoint initial-checkpoint.json \ + --gateway-address 0x1F98431c8aD98523631AE4a59f267346ea31F984 \ + --gateway-operating-mode normal +``` + +The preimage can be tested using the generated `chopsticks-execute-upgrade.js` script + +NOTE: Since the 1.2.0 upgrade has not executed yet on mainnet Polkadot, I tested the tool using a local zombienet or chopsticks environment. Pass the `--bridge-hub-api` the `--asset-hub-api` params to override the default API endpoints. + +## Update runtime bindings + +To generate runtime bindings that include the 1.2.0 runtime release, we need to start a local `polkadot-local` network using zombienet. + +Build polkadot executables: + +```shell +cd $WORKSPACE/polkadot-sdk +cargo build --release +cp target/release/{polkadot,polkadot-prepare-worker,polkadot-execute-worker,polkadot-parachain} $WORKDIR/ +``` + +Build the `chain-spec-generator` for production runtimes: + +```shell +cd $WORKSPACE/runtimes +cargo build -p chain-spec-generator --profile production +cp target/production/chain-spec-generator $WORKDIR/ +``` + +Create initial chainspecs: + +```shell +chain-spec-generator polkadot-local > polkadot-local.json +chain-spec-generator asset-hub-polkadot-local > asset-hub-polkadot-local.json +chain-spec-generator bridge-hub-polkadot-local > bridge-hub-polkadot-local.json +``` + +Launch zombienet: + +```shell +zombienet spawn launch-config.toml +``` + +Update bindings: + +```shell +subxt metadata --url ws://127.0.0.1:8000 -f bytes -o runtimes/polkadot/polkadot-metadata.bin +subxt metadata --url ws://127.0.0.1:8001 -f bytes -o runtimes/bridge-hub-polkadot/bridge-hub-metadata.bin +subxt metadata --url ws://127.0.0.1:8002 -f bytes -o runtimes/asset-hub-polkadot/asset-hub-metadata.bin +``` diff --git a/control/launch-config.toml b/control/launch-config.toml new file mode 100644 index 0000000000..153bf13e57 --- /dev/null +++ b/control/launch-config.toml @@ -0,0 +1,67 @@ +[settings] +node_spawn_timeout = 120 +provider = "native" +timeout = 600 + +[relaychain] +default_command = "./polkadot" +default_args = [ + "--enable-offchain-indexing=true", + "--pruning", + "archive", + "--disable-worker-version-check", + "--state-cache-size=0", +] +chain = "polkadot-local" +chain_spec_path = "./polkadot-local.json" + +[[relaychain.nodes]] +name = "alice" +args = ["--alice"] +ws_port = 8000 +validator = true + +[[relaychain.nodes]] +name = "bob" +args = ["--bob"] +validator = true + +[[relaychain.nodes]] +name = "charlie" +args = ["--charlie"] +validator = true + +[[relaychain.nodes]] +name = "dave" +args = ["--dave"] +validator = true + +## AssetHub +[[parachains]] +id = 1000 +chain_spec_path = "./asset-hub-polkadot-local.json" +cumulus_based = true +chain = "asset-hub-polkadot-local" + +[[parachains.collators]] +name = "assethub01" +command = "./polkadot-parachain" +args = ["--no-hardware-benchmarks"] +ws_port = 8001 + +## Bridge Hub +[[parachains]] +id = 1002 +chain_spec_path = "./bridge-hub-polkadot-local.json" +cumulus_based = true +chain = "bridge-hub-polkadot-local" + +[[parachains.collators]] +args = [ + "--enable-offchain-indexing=true", + "--pruning=archive", + "--no-hardware-benchmarks", +] +name = "bridgehub01" +command = "./polkadot-parachain" +ws_port = 8002 diff --git a/control/preimage/Cargo.toml b/control/preimage/Cargo.toml index 69b6994c2b..d5964414c4 100644 --- a/control/preimage/Cargo.toml +++ b/control/preimage/Cargo.toml @@ -9,22 +9,42 @@ edition = "2021" futures = "0.3.30" tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread", "time"] } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } -scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = [ + "derive", +] } hex-literal = { version = "0.4.1" } clap = { version = "4.5.1", features = ["derive"] } hex = "0.4.3" -subxt = { version = "0.34.0", features = ["substrate-compat"] } +subxt = { version = "0.35.1", features = ["substrate-compat"] } serde = { version = "1.0.197", features = ["derive"] } sp-arithmetic = "24.0.0" alloy-primitives = "0.6.3" +snowbridge-beacon-primitives = "0.2.0" rococo-runtime = { path = "../runtimes/rococo", optional = true } bridge-hub-rococo-runtime = { path = "../runtimes/bridge-hub-rococo", optional = true } +asset-hub-rococo-runtime = { path = "../runtimes/asset-hub-rococo", optional = true } + +polkadot-runtime = { path = "../runtimes/polkadot", optional = true } +bridge-hub-polkadot-runtime = { path = "../runtimes/bridge-hub-polkadot", optional = true } +asset-hub-polkadot-runtime = { path = "../runtimes/asset-hub-polkadot", optional = true } + +serde_json = "1.0.114" +sp-crypto-hashing = "0.1.0" +handlebars = "5.1.2" [features] -default = ["rococo"] -rococo = ["rococo-runtime", "bridge-hub-rococo-runtime"] +default = ["polkadot"] +rococo = [ + "rococo-runtime", + "asset-hub-rococo-runtime", + "bridge-hub-rococo-runtime", +] kusama = [] -polkadot = [] +polkadot = [ + "polkadot-runtime", + "asset-hub-polkadot-runtime", + "bridge-hub-polkadot-runtime", +] diff --git a/control/preimage/build.rs b/control/preimage/build.rs index 100fde2adf..73f98cda43 100644 --- a/control/preimage/build.rs +++ b/control/preimage/build.rs @@ -1,5 +1,3 @@ fn main() { - // Tell Cargo that if the given file changes, to rerun this build script (i.e. recompile) - println!("cargo:rerun-if-changed=polkadot-metadata.bin"); - println!("cargo:rerun-if-changed=bridge-hub-metadata.bin"); + println!("cargo:rerun-if-changed=templates"); } diff --git a/control/preimage/snowbridge-preimage.hex b/control/preimage/snowbridge-preimage.hex new file mode 100644 index 0000000000..e69de29bb2 diff --git a/control/preimage/src/asset_hub_runtime.rs b/control/preimage/src/asset_hub_runtime.rs new file mode 100644 index 0000000000..8f6b76d607 --- /dev/null +++ b/control/preimage/src/asset_hub_runtime.rs @@ -0,0 +1,9 @@ +#[cfg(feature = "rococo")] +pub use asset_hub_polkadot_runtime::runtime_types::asset_hub_polkadot_runtime::RuntimeCall; +#[cfg(feature = "rococo")] +pub use asset_hub_rococo_runtime::*; + +#[cfg(feature = "polkadot")] +pub use asset_hub_polkadot_runtime::runtime_types::asset_hub_polkadot_runtime::RuntimeCall; +#[cfg(feature = "polkadot")] +pub use asset_hub_polkadot_runtime::*; diff --git a/control/preimage/src/bridge_hub_runtime.rs b/control/preimage/src/bridge_hub_runtime.rs index 9db0be1f3b..79406971b0 100644 --- a/control/preimage/src/bridge_hub_runtime.rs +++ b/control/preimage/src/bridge_hub_runtime.rs @@ -1,2 +1,9 @@ #[cfg(feature = "rococo")] +pub use bridge_hub_rococo_runtime::runtime_types::bridge_hub_rococo_runtime::RuntimeCall; +#[cfg(feature = "rococo")] pub use bridge_hub_rococo_runtime::*; + +#[cfg(feature = "polkadot")] +pub use bridge_hub_polkadot_runtime::runtime_types::bridge_hub_polkadot_runtime::RuntimeCall; +#[cfg(feature = "polkadot")] +pub use bridge_hub_polkadot_runtime::*; diff --git a/control/preimage/src/chopsticks.rs b/control/preimage/src/chopsticks.rs new file mode 100644 index 0000000000..af1e089cea --- /dev/null +++ b/control/preimage/src/chopsticks.rs @@ -0,0 +1,58 @@ +use codec::Encode; +use handlebars::Handlebars; +use serde::Serialize; +use sp_crypto_hashing::blake2_256; +use std::io::prelude::*; +use std::{fs::File, path::PathBuf}; + +#[derive(Clone, Serialize, Debug)] +struct TemplateData { + preimage: Preimage, +} + +impl TemplateData { + fn new(preimage: &[u8]) -> Self { + TemplateData { + preimage: preimage.into(), + } + } +} + +#[derive(Clone, Serialize, Debug)] +struct Preimage { + hash: String, + bytes: String, + size: String, +} + +impl From<&[u8]> for Preimage { + fn from(data: &[u8]) -> Self { + Preimage { + hash: as_hex_literal(&blake2_256(data)), + size: format!("{}", data.len()), + bytes: as_hex_literal(&data.to_owned().encode()), + } + } +} + +fn as_hex_literal(s: &[u8]) -> String { + format!("0x{}", hex::encode(s)) +} + +pub fn generate_chopsticks_script( + preimage: &[u8], + output_path: PathBuf, +) -> Result<(), Box> { + let mut registry = Handlebars::new(); + + // Disable HTML escaping + registry.register_escape_fn(|s| -> String { s.to_string() }); + + let template = include_str!("../templates/chopsticks-execute-upgrade.js.hbs"); + let data = TemplateData::new(preimage); + let output = registry.render_template(template, &data)?; + let mut file = File::create(output_path)?; + file.write_all(output.as_bytes())?; + + Ok(()) +} diff --git a/control/preimage/src/commands.rs b/control/preimage/src/commands.rs index 0aac14186a..a3d051820c 100644 --- a/control/preimage/src/commands.rs +++ b/control/preimage/src/commands.rs @@ -1,44 +1,164 @@ -use super::{Context, GatewayOperatingModeArg}; -use crate::helpers::wrap_calls; +use crate::bridge_hub_runtime::runtime_types::snowbridge_pallet_ethereum_client; +use crate::helpers::calculate_delivery_fee; +use crate::{ + constants::*, Context, ForceCheckpointArgs, GatewayAddressArgs, GatewayOperatingModeArgs, + GatewayOperatingModeEnum, PricingParametersArgs, UpgradeArgs, +}; +use alloy_primitives::{utils::format_units, U256}; +use codec::Encode; +use sp_arithmetic::FixedU128; +use sp_crypto_hashing::twox_128; +use std::{fs::File, io::Read}; +use subxt::utils::Static; + +type CheckpointUpdate = snowbridge_beacon_primitives::CheckpointUpdate<512>; -use alloy_primitives::{Address, Bytes, FixedBytes}; -use subxt::utils::{H160, H256}; +use crate::asset_hub_runtime::RuntimeCall as AssetHubRuntimeCall; use crate::bridge_hub_runtime::runtime_types::{ - snowbridge_core::outbound::v1::{Initializer, OperatingMode}, - bridge_hub_rococo_runtime::RuntimeCall as BridgeHubRuntimeCall, + snowbridge_core::{ + outbound::v1::{Initializer, OperatingMode}, + pricing::{PricingParameters, Rewards}, + }, snowbridge_pallet_system, }; +use crate::bridge_hub_runtime::RuntimeCall as BridgeHubRuntimeCall; -use crate::relay_runtime::runtime_types::polkadot_runtime::RuntimeCall as RelayRuntimeCall; +pub fn gateway_operating_mode(params: &GatewayOperatingModeArgs) -> BridgeHubRuntimeCall { + let mode = match params.gateway_operating_mode { + GatewayOperatingModeEnum::Normal => OperatingMode::Normal, + GatewayOperatingModeEnum::RejectingOutboundMessages => { + OperatingMode::RejectingOutboundMessages + } + }; + BridgeHubRuntimeCall::EthereumSystem( + snowbridge_pallet_system::pallet::Call::set_operating_mode { mode }, + ) +} -pub async fn gateway_operating_mode(context: &Context, mode: GatewayOperatingModeArg) -> Result> { - let mode = match mode { - GatewayOperatingModeArg::Normal => OperatingMode::Normal, - GatewayOperatingModeArg::RejectingOutboundMessages => OperatingMode::RejectingOutboundMessages, +pub fn upgrade(params: &UpgradeArgs) -> BridgeHubRuntimeCall { + let initializer = if params.initializer { + Some(( + params.initializer_params.as_ref().unwrap().clone(), + params.initializer_gas.unwrap(), + )) + } else { + None }; - let call = BridgeHubRuntimeCall::EthereumSystem(snowbridge_pallet_system::pallet::Call::set_operating_mode { mode }); - let call = wrap_calls(context, vec![call]).await?; - Ok(call) + BridgeHubRuntimeCall::EthereumSystem(snowbridge_pallet_system::pallet::Call::upgrade { + impl_address: params.logic_address.into_array().into(), + impl_code_hash: params.logic_code_hash.0.into(), + initializer: initializer.map(|(params, gas)| Initializer { + params: params.into(), + maximum_required_gas: gas, + }), + }) } -pub async fn upgrade( +pub async fn pricing_parameters( context: &Context, - logic_address: Address, - logic_code_hash: FixedBytes<32>, - initializer: Option<(Bytes, u64)>, -) -> Result> { - let call = BridgeHubRuntimeCall::EthereumSystem( - snowbridge_pallet_system::pallet::Call::upgrade { - impl_address: H160::from_slice(logic_address.as_slice()), - impl_code_hash: H256::from_slice(logic_code_hash.as_slice()), - initializer: initializer.map(|(params, gas)| Initializer { - params: params.into(), - maximum_required_gas: gas, - }), - } + params: &PricingParametersArgs, +) -> Result<(BridgeHubRuntimeCall, AssetHubRuntimeCall), Box> { + // BridgeHub parameters + let pricing_params: PricingParameters = PricingParameters { + exchange_rate: Static(FixedU128::from_rational( + params.exchange_rate_numerator.into(), + params.exchange_rate_denominator.into(), + )), + multiplier: Static(FixedU128::from_rational( + params.multiplier_numerator.into(), + params.multiplier_denominator.into(), + )), + fee_per_gas: crate::bridge_hub_runtime::runtime_types::primitive_types::U256( + params.fee_per_gas.into_limbs(), + ), + rewards: Rewards { + local: params.local_reward.to::(), + remote: crate::bridge_hub_runtime::runtime_types::primitive_types::U256( + params.remote_reward.into_limbs(), + ), + }, + }; + + let outbound_delivery_fee = + calculate_delivery_fee(&context.bridge_hub_api, &pricing_params).await?; + + let total_outbound_fee = outbound_delivery_fee.local + outbound_delivery_fee.remote; + + // Adjust outbound fee up by 10% as a buffer + let total_outbound_fee_adjusted = total_outbound_fee.saturating_add(total_outbound_fee / 10); + + eprintln!("BridgeHub:"); + eprintln!( + " ExchangeRate: {} ETH/{}", + params.exchange_rate_numerator as f64 / params.exchange_rate_denominator as f64, + POLKADOT_SYMBOL ); - let call = wrap_calls(context, vec![call]).await?; - Ok(call) + eprintln!( + " FeePerGas: {} GWEI", + format_units(params.fee_per_gas, "gwei").unwrap(), + ); + eprintln!( + " LocalReward: {} {} [{} PLANCK]", + format_units(U256::from(params.local_reward), POLKADOT_DECIMALS).unwrap(), + POLKADOT_SYMBOL, + params.local_reward, + ); + eprintln!( + " RemoteReward: {} ETH [{} WEI]", + format_units(params.remote_reward, "eth").unwrap(), + params.remote_reward + ); + eprintln!("AssetHub:"); + eprintln!( + " BaseFee: {} {}, [{} PLANCK]", + format_units(U256::from(total_outbound_fee_adjusted), POLKADOT_DECIMALS).unwrap(), + POLKADOT_SYMBOL, + total_outbound_fee_adjusted + ); + + // AssetHub parameters + let asset_hub_outbound_fee_storage_key: Vec = + twox_128(b":BridgeHubEthereumBaseFee:").to_vec(); + let asset_hub_outbound_fee_encoded: Vec = total_outbound_fee_adjusted.encode(); + + Ok(( + BridgeHubRuntimeCall::EthereumSystem( + snowbridge_pallet_system::pallet::Call::set_pricing_parameters { + params: pricing_params, + }, + ), + AssetHubRuntimeCall::System( + crate::asset_hub_runtime::runtime_types::frame_system::pallet::Call::set_storage { + items: vec![( + asset_hub_outbound_fee_storage_key, + asset_hub_outbound_fee_encoded, + )], + }, + ), + )) +} + +pub fn force_checkpoint(params: &ForceCheckpointArgs) -> BridgeHubRuntimeCall { + let mut file = File::open(params.checkpoint.clone()).expect("File not found"); + let mut data = String::new(); + file.read_to_string(&mut data) + .expect("Failed to read the file"); + let checkpoint: CheckpointUpdate = serde_json::from_str(&data).unwrap(); + BridgeHubRuntimeCall::EthereumBeaconClient( + snowbridge_pallet_ethereum_client::pallet::Call::force_checkpoint { + update: Box::new(Static(checkpoint)), + }, + ) +} + +pub fn set_gateway_address(params: &GatewayAddressArgs) -> BridgeHubRuntimeCall { + let storage_key = sp_crypto_hashing::twox_128(b":EthereumGatewayAddress:").to_vec(); + let storage_value = params.gateway_address.into_array().encode(); + BridgeHubRuntimeCall::System( + crate::bridge_hub_runtime::runtime_types::frame_system::pallet::Call::set_storage { + items: vec![(storage_key, storage_value)], + }, + ) } diff --git a/control/preimage/src/constants.rs b/control/preimage/src/constants.rs new file mode 100644 index 0000000000..90126df8d3 --- /dev/null +++ b/control/preimage/src/constants.rs @@ -0,0 +1,25 @@ +#[cfg(feature = "rococo")] +mod rococo { + pub const POLKADOT_SYMBOL: &str = "ROC"; + pub const POLKADOT_DECIMALS: u8 = 12; + pub const ASSET_HUB_ID: u32 = 1000; + pub const ASSET_HUB_API: &str = "wss://rococo-asset-hub-rpc.polkadot.io"; + pub const BRIDGE_HUB_ID: u32 = 1002; + pub const BRIDGE_HUB_API: &str = "wss://rococo-bridge-hub-rpc.polkadot.io"; +} + +#[cfg(feature = "rococo")] +pub use rococo::*; + +#[cfg(feature = "polkadot")] +mod polkadot { + pub const POLKADOT_SYMBOL: &str = "DOT"; + pub const POLKADOT_DECIMALS: u8 = 10; + pub const ASSET_HUB_ID: u32 = 1000; + pub const ASSET_HUB_API: &str = "wss://polkadot-asset-hub-rpc.polkadot.io"; + pub const BRIDGE_HUB_ID: u32 = 1002; + pub const BRIDGE_HUB_API: &str = "wss://polkadot-bridge-hub-rpc.polkadot.io"; +} + +#[cfg(feature = "polkadot")] +pub use polkadot::*; diff --git a/control/preimage/src/helpers.rs b/control/preimage/src/helpers.rs index b1c9d86e83..93516f30f7 100644 --- a/control/preimage/src/helpers.rs +++ b/control/preimage/src/helpers.rs @@ -1,55 +1,70 @@ -use subxt::{OnlineClient, PolkadotConfig}; +use bridge_hub_runtime::ethereum_system::storage::types::pricing_parameters::PricingParameters; use codec::Encode; +use subxt::{utils::H160, utils::H256, OnlineClient, PolkadotConfig}; +use crate::constants::{ASSET_HUB_ID, BRIDGE_HUB_ID}; use crate::Context; -use crate::bridge_hub_runtime::{ - self, - runtime_types::bridge_hub_rococo_runtime::RuntimeCall as BridgeHubRuntimeCall, -}; +use crate::bridge_hub_runtime::{self, RuntimeCall as BridgeHubRuntimeCall}; use crate::relay_runtime::runtime_types::{ - polkadot_runtime::RuntimeCall as RelayRuntimeCall, + pallet_xcm, sp_weights::weight_v2::Weight, + staging_xcm::v3::multilocation::MultiLocation, xcm::{ double_encoded::DoubleEncoded, v2::OriginKind, - v3::{Instruction::{self, *}, junction::Junction, junctions::Junctions, WeightLimit, MaybeErrorCode, Xcm}, - VersionedXcm, - VersionedMultiLocation + v3::{ + junction::Junction, + junctions::Junctions, + Instruction::{self, *}, + MaybeErrorCode, WeightLimit, Xcm, + }, + VersionedLocation, VersionedXcm, }, - staging_xcm::v3::multilocation::MultiLocation, - pallet_xcm }; +use crate::relay_runtime::RuntimeCall as RelayRuntimeCall; + +use crate::asset_hub_runtime::RuntimeCall as AssetHubRuntimeCall; use sp_arithmetic::helpers_128bit::multiply_by_rational_with_rounding; use sp_arithmetic::per_things::Rounding; -// Increase call weight by 10% as a buffer in case the chain is upgraded with new weights +const MAX_REF_TIME: u128 = 500_000_000_000 - 1; +const MAX_PROOF_SIZE: u128 = 3 * 1024 * 1024 - 1; + +// Increase call weight by 25% as a buffer in case the chain is upgraded with new weights // while the proposal is still in flight. pub fn increase_weight(ref_time: &mut u64, proof_size: &mut u64) { - let x = multiply_by_rational_with_rounding(*ref_time as u128, 110, 100, Rounding::Up).expect("overflow"); - let y = multiply_by_rational_with_rounding(*proof_size as u128, 110, 100, Rounding::Up).expect("overflow"); - - *ref_time = x.try_into().expect("overflow"); - *proof_size = y.try_into().expect("overflow"); + let _ref_time = multiply_by_rational_with_rounding(*ref_time as u128, 125, 100, Rounding::Up) + .expect("overflow") + .min(MAX_REF_TIME); + let _proof_size = + multiply_by_rational_with_rounding(*proof_size as u128, 125, 100, Rounding::Up) + .expect("overflow") + .min(MAX_PROOF_SIZE); + + *ref_time = _ref_time.try_into().expect("overflow"); + *proof_size = _proof_size.try_into().expect("overflow"); } -pub async fn wrap_calls(context: &Context, calls: Vec) -> Result> { +pub async fn send_xcm_bridge_hub( + context: &Context, + calls: Vec, +) -> Result> { let mut accum: Vec<(u64, u64, Vec)> = vec![]; for call in calls.iter() { - let (mut ref_time, mut proof_size) = query_weight(&context.api, call.clone()).await?; + let (mut ref_time, mut proof_size) = + query_weight_bridge_hub(&context.bridge_hub_api, call.clone()).await?; increase_weight(&mut ref_time, &mut proof_size); accum.push((ref_time, proof_size, call.encode())); } - let mut instructions: Vec = vec![ - UnpaidExecution { - weight_limit: WeightLimit::Unlimited, - check_origin: None, - }, - ]; + let mut instructions: Vec = vec![UnpaidExecution { + weight_limit: WeightLimit::Unlimited, + check_origin: None, + }]; for (ref_time, proof_size, encoded) in accum.into_iter() { instructions.append(&mut vec![ @@ -65,21 +80,67 @@ pub async fn wrap_calls(context: &Context, calls: Vec) -> ]); } - let para_id = query_para_id(&context.api).await?; + let call = RelayRuntimeCall::XcmPallet(pallet_xcm::pallet::Call::send { + dest: Box::new(VersionedLocation::V3(MultiLocation { + parents: 0, + interior: Junctions::X1(Junction::Parachain(BRIDGE_HUB_ID)), + })), + message: Box::new(VersionedXcm::V3(Xcm(instructions))), + }); + + Ok(call) +} + +pub async fn send_xcm_asset_hub( + context: &Context, + calls: Vec, +) -> Result> { + let mut accum: Vec<(u64, u64, Vec)> = vec![]; + + for call in calls.iter() { + let (mut ref_time, mut proof_size) = + query_weight_asset_hub(&context.asset_hub_api, call.clone()).await?; + increase_weight(&mut ref_time, &mut proof_size); + accum.push((ref_time, proof_size, call.encode())); + } + + let mut instructions: Vec = vec![UnpaidExecution { + weight_limit: WeightLimit::Unlimited, + check_origin: None, + }]; + + for (ref_time, proof_size, encoded) in accum.into_iter() { + instructions.append(&mut vec![ + Transact { + origin_kind: OriginKind::Superuser, + require_weight_at_most: Weight { + ref_time: ref_time, + proof_size: proof_size, + }, + call: DoubleEncoded { encoded }, + }, + ExpectTransactStatus(MaybeErrorCode::Success), + ]); + } let call = RelayRuntimeCall::XcmPallet(pallet_xcm::pallet::Call::send { - dest: Box::new(VersionedMultiLocation::V3(MultiLocation { + dest: Box::new(VersionedLocation::V3(MultiLocation { parents: 0, - interior: Junctions::X1(Junction::Parachain(para_id)), + interior: Junctions::X1(Junction::Parachain(ASSET_HUB_ID)), })), - message: Box::new(VersionedXcm::V3(Xcm(instructions))) + message: Box::new(VersionedXcm::V3(Xcm(instructions))), }); Ok(call) } -pub async fn query_weight(api: &OnlineClient, call: BridgeHubRuntimeCall) -> Result<(u64, u64), Box> { - let runtime_api_call = bridge_hub_runtime::apis().transaction_payment_call_api().query_call_info(call, 0); +pub async fn query_weight_bridge_hub( + api: &OnlineClient, + call: BridgeHubRuntimeCall, +) -> Result<(u64, u64), Box> { + let runtime_api_call = bridge_hub_runtime::apis() + .transaction_payment_call_api() + .query_call_info(call, 0); let call_info = api .runtime_api() .at_latest() @@ -89,15 +150,71 @@ pub async fn query_weight(api: &OnlineClient, call: BridgeHubRun Ok((call_info.weight.ref_time, call_info.weight.proof_size)) } -pub async fn query_para_id(api: &OnlineClient) -> Result> { - let storage_query = bridge_hub_runtime::storage().parachain_info().parachain_id(); - let bridge_hub_para_id = api - .storage() +pub async fn query_weight_asset_hub( + api: &OnlineClient, + call: AssetHubRuntimeCall, +) -> Result<(u64, u64), Box> { + let runtime_api_call = crate::asset_hub_runtime::apis() + .transaction_payment_call_api() + .query_call_info(call, 0); + let call_info = api + .runtime_api() .at_latest() .await? - .fetch(&storage_query) + .call(runtime_api_call) + .await?; + Ok((call_info.weight.ref_time, call_info.weight.proof_size)) +} + +pub fn utility_force_batch(calls: Vec) -> RelayRuntimeCall { + RelayRuntimeCall::Utility( + crate::relay_runtime::runtime_types::pallet_utility::pallet::Call::force_batch { calls }, + ) +} + +pub fn force_xcm_version() -> AssetHubRuntimeCall { + use crate::asset_hub_runtime::runtime_types::staging_xcm::v4::{ + junction::Junction::GlobalConsensus, junction::NetworkId, junctions::Junctions::X1, + location::Location, + }; + let location = Box::new(Location { + parents: 2, + interior: X1([GlobalConsensus(NetworkId::Ethereum { chain_id: 1 })]), + }); + + AssetHubRuntimeCall::PolkadotXcm( + crate::asset_hub_runtime::runtime_types::pallet_xcm::pallet::Call::force_xcm_version { + location, + version: 4, + }, + ) +} + +use bridge_hub_runtime::runtime_types::snowbridge_core::outbound::v1::AgentExecuteCommand; +use bridge_hub_runtime::runtime_types::snowbridge_core::outbound::v1::Command; +use bridge_hub_runtime::runtime_types::snowbridge_core::outbound::Fee; + +pub async fn calculate_delivery_fee( + api: &OnlineClient, + params: &PricingParameters, +) -> Result, Box> { + let command = Command::AgentExecute { + agent_id: H256::zero(), + command: AgentExecuteCommand::TransferToken { + token: H160::zero(), + recipient: H160::zero(), + amount: 0, + }, + }; + let runtime_api_call = bridge_hub_runtime::apis() + .outbound_queue_api() + .calculate_fee(command, Some(params.clone())); + let fee = api + .runtime_api() + .at_latest() .await? - .expect("parachain id not set"); + .call(runtime_api_call) + .await?; - Ok(bridge_hub_para_id.0) + Ok(fee) } diff --git a/control/preimage/src/main.rs b/control/preimage/src/main.rs index abeefe8db4..6043770004 100644 --- a/control/preimage/src/main.rs +++ b/control/preimage/src/main.rs @@ -1,151 +1,271 @@ +mod asset_hub_runtime; mod bridge_hub_runtime; -mod relay_runtime; +mod chopsticks; mod commands; +mod constants; mod helpers; +mod relay_runtime; +use alloy_primitives::{utils::parse_units, Address, Bytes, FixedBytes, U128, U256}; +use chopsticks::generate_chopsticks_script; +use clap::{Args, Parser, Subcommand, ValueEnum}; use codec::Encode; -use clap::{Parser, Subcommand, ValueEnum}; +use constants::{ASSET_HUB_API, BRIDGE_HUB_API, POLKADOT_DECIMALS, POLKADOT_SYMBOL}; +use helpers::{force_xcm_version, send_xcm_asset_hub, send_xcm_bridge_hub, utility_force_batch}; +use std::{io::Write, path::PathBuf}; use subxt::{OnlineClient, PolkadotConfig}; -use std::io::Write; -use alloy_primitives::{Address, Bytes, FixedBytes}; #[derive(Debug, Parser)] -#[command(name = "snowbridge-control", version, about, long_about = None)] +#[command(name = "snowbridge-preimage", version, about, long_about = None)] struct Cli { /// Output format of preimage #[arg(long, value_enum, default_value_t=Format::Hex)] format: Format, + #[command(flatten)] + api_endpoints: ApiEndpoints, + #[command(subcommand)] command: Command, } #[derive(Debug, Subcommand)] pub enum Command { - /// Change the gateway operating mode - GatewayOperatingMode { - /// Operating mode - #[arg(value_enum)] - mode: GatewayOperatingModeArg, - }, + /// Initialize the bridge + Initialize(InitializeArgs), /// Upgrade the Gateway contract - Upgrade { + Upgrade(UpgradeArgs), + /// Change the gateway operating mode + GatewayOperatingMode(GatewayOperatingModeArgs), + /// Set pricing parameters + PricingParameters(PricingParametersArgs), + /// Set the checkpoint for the beacon light client + ForceCheckpoint(ForceCheckpointArgs), +} - /// Address of the logic contract - #[arg(long, value_name = "ADDRESS", value_parser=parse_eth_address)] - logic_address: Address, +#[derive(Debug, Args)] +pub struct InitializeArgs { + #[command(flatten)] + gateway_operating_mode: GatewayOperatingModeArgs, + #[command(flatten)] + pricing_parameters: PricingParametersArgs, + #[command(flatten)] + force_checkpoint: ForceCheckpointArgs, + #[command(flatten)] + gateway_address: GatewayAddressArgs, +} - /// Hash of the code in the logic contract - #[arg(long, value_name = "HASH", value_parser=parse_hex_bytes32)] - logic_code_hash: FixedBytes<32>, +#[derive(Debug, Args)] +pub struct UpgradeArgs { + /// Address of the logic contract + #[arg(long, value_name = "ADDRESS", value_parser=parse_eth_address)] + logic_address: Address, - /// Initialize the logic contract - #[arg(long, requires_all=["initializer_params", "initializer_gas"])] - initializer: bool, + /// Hash of the code in the logic contract + #[arg(long, value_name = "HASH", value_parser=parse_hex_bytes32)] + logic_code_hash: FixedBytes<32>, - /// ABI-encoded params to pass to initializer - #[arg(long, requires = "initializer", value_name = "BYTES", value_parser=parse_hex_bytes)] - initializer_params: Option, + /// Initialize the logic contract + #[arg(long, requires_all=["initializer_params", "initializer_gas"])] + initializer: bool, - /// Maximum gas required by the initializer - #[arg(long, requires = "initializer", value_name = "GAS")] - initializer_gas: Option, - } + /// ABI-encoded params to pass to initializer + #[arg(long, requires = "initializer", value_name = "BYTES", value_parser=parse_hex_bytes)] + initializer_params: Option, + + /// Maximum gas required by the initializer + #[arg(long, requires = "initializer", value_name = "GAS")] + initializer_gas: Option, +} + +#[derive(Debug, Args)] +pub struct GatewayOperatingModeArgs { + /// Operating mode + #[arg(long, value_enum)] + gateway_operating_mode: GatewayOperatingModeEnum, +} + +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, ValueEnum)] +pub enum GatewayOperatingModeEnum { + Normal, + RejectingOutboundMessages, +} + +#[derive(Debug, Args)] +pub struct GatewayAddressArgs { + /// Address of the contract on Ethereum + #[arg(long, value_name = "ADDRESS")] + pub gateway_address: Address, +} + +#[derive(Debug, Args)] +pub struct ForceCheckpointArgs { + /// Path to JSON file containing checkpoint + #[arg(long, value_name = "FILE")] + pub checkpoint: PathBuf, +} + +#[derive(Debug, Args)] +pub struct PricingParametersArgs { + /// Numerator for ETH/DOT Exchange rate + /// + /// For example, if the exchange rate is 1/400 (exchange 1 ETH for 400 DOT), then NUMERATOR should be 1. + #[arg(long, value_name = "UINT")] + pub exchange_rate_numerator: u64, + /// Denominator for ETH/DOT Exchange rate + /// + /// For example, if the exchange rate is 1/400 (exchange 1 ETH for 400 DOT), then DENOMINATOR should be 400. + #[arg(long, value_name = "UINT")] + pub exchange_rate_denominator: u64, + /// Numerator for Multiplier + /// + /// For example, if the multiplier is 4/3, then NUMERATOR should be 4. + #[arg(long, value_name = "UINT")] + pub multiplier_numerator: u64, + /// Denominator for Multiplier + /// + /// For example, if the multiplier is 4/3, then DENOMINATOR should be 3. + #[arg(long, value_name = "UINT")] + pub multiplier_denominator: u64, + /// Ether fee per unit of gas + #[arg(long, value_name = "GWEI", value_parser = parse_units_gwei)] + pub fee_per_gas: U256, + /// Relayer reward for delivering messages to Polkadot + #[arg(long, value_name = POLKADOT_SYMBOL, value_parser = parse_units_polkadot)] + pub local_reward: U128, + /// Relayer reward for delivering messages to Ethereum + #[arg(long, value_name = "ETHER", value_parser = parse_units_eth)] + pub remote_reward: U256, +} + +#[derive(Debug, Args)] +pub struct ApiEndpoints { + #[arg(long, value_name = "URL")] + bridge_hub_api: Option, + + #[arg(long, value_name = "URL")] + asset_hub_api: Option, } fn parse_eth_address(v: &str) -> Result { - Address::parse_checksummed(v, None).map_err(|_| { - "invalid ethereum address".to_owned() - }) + Address::parse_checksummed(v, None).map_err(|_| "invalid ethereum address".to_owned()) } fn parse_hex_bytes32(v: &str) -> Result, String> { - v.parse::>().map_err(|_| { - "invalid 32-byte hex value".to_owned() - }) + v.parse::>() + .map_err(|_| "invalid 32-byte hex value".to_owned()) } fn parse_hex_bytes(v: &str) -> Result { - v.parse::().map_err(|_| { - "invalid hex value".to_owned() - }) + v.parse::() + .map_err(|_| "invalid hex value".to_owned()) } +fn parse_units_polkadot(v: &str) -> Result { + let amount = parse_units(v, POLKADOT_DECIMALS).map_err(|e| format!("{e}"))?; + let amount: U256 = amount.into(); + let amount: U128 = amount.to::(); + Ok(amount) +} -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, ValueEnum)] -pub enum Format { - Hex, - Binary, +fn parse_units_gwei(v: &str) -> Result { + let amount = parse_units(v, "gwei").map_err(|e| format!("{e}"))?; + Ok(amount.into()) } -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, ValueEnum)] -pub enum GatewayOperatingModeArg { - Normal, - RejectingOutboundMessages, +fn parse_units_eth(v: &str) -> Result { + let amount = parse_units(v, "ether").map_err(|e| format!("{e}"))?; + Ok(amount.into()) } -struct StaticConfig<'a> { - api: &'a str, +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, ValueEnum)] +pub enum Format { + Hex, + Binary, } struct Context { - api: Box>, + bridge_hub_api: Box>, + asset_hub_api: Box>, } -#[cfg(feature = "rococo")] -static CONFIG: StaticConfig<'static> = StaticConfig { - api: "wss://rococo-bridge-hub-rpc.polkadot.io", -}; - -#[cfg(feature = "kusama")] -static CONFIG: StaticConfig<'static> = StaticConfig { - api: "wss://kusama-bridge-hub-rpc.polkadot.io", -}; - -#[cfg(feature = "polkadot")] -static CONFIG: StaticConfig<'static> = StaticConfig { - api: "wss://polkadot-bridge-hub-rpc.polkadot.io", -}; - #[tokio::main] -async fn main() -> Result<(), Box> { +async fn main() { + if let Err(err) = run().await { + eprintln!("{err}"); + } +} + +async fn run() -> Result<(), Box> { let cli = Cli::parse(); - let api: OnlineClient = OnlineClient::from_url(CONFIG.api) - .await - .expect("can not connect to bridgehub"); + let bridge_hub_api: OnlineClient = OnlineClient::from_url( + cli.api_endpoints + .bridge_hub_api + .unwrap_or(BRIDGE_HUB_API.to_owned()), + ) + .await?; + + let asset_hub_api: OnlineClient = OnlineClient::from_url( + cli.api_endpoints + .asset_hub_api + .unwrap_or(ASSET_HUB_API.to_owned()), + ) + .await?; let context = Context { - api: Box::new(api) + bridge_hub_api: Box::new(bridge_hub_api), + asset_hub_api: Box::new(asset_hub_api), }; let call = match &cli.command { - Command::GatewayOperatingMode { mode } => { - commands::gateway_operating_mode(&context, *mode).await? - }, - Command::Upgrade { logic_address, logic_code_hash, initializer, initializer_params, initializer_gas} => { - let initializer = if *initializer { - Some((initializer_params.as_ref().unwrap().clone(), initializer_gas.unwrap())) - } else { - None - }; - commands::upgrade( + Command::ForceCheckpoint(params) => { + let call = commands::force_checkpoint(params); + send_xcm_bridge_hub(&context, vec![call]).await? + } + Command::Initialize(params) => { + let (set_pricing_parameters, set_ethereum_fee) = + commands::pricing_parameters(&context, ¶ms.pricing_parameters).await?; + let call1 = send_xcm_bridge_hub( &context, - *logic_address, - *logic_code_hash, - initializer - ).await? + vec![ + commands::set_gateway_address(¶ms.gateway_address), + set_pricing_parameters, + commands::force_checkpoint(¶ms.force_checkpoint), + ], + ) + .await?; + let call2 = + send_xcm_asset_hub(&context, vec![force_xcm_version(), set_ethereum_fee]).await?; + utility_force_batch(vec![call1, call2]) + } + Command::GatewayOperatingMode(params) => { + let call = commands::gateway_operating_mode(params); + send_xcm_bridge_hub(&context, vec![call]).await? + } + Command::Upgrade(params) => { + let call = commands::upgrade(params); + send_xcm_bridge_hub(&context, vec![call]).await? + } + Command::PricingParameters(params) => { + let (set_pricing_parameters, set_ethereum_fee) = + commands::pricing_parameters(&context, params).await?; + let call1 = send_xcm_bridge_hub(&context, vec![set_pricing_parameters]).await?; + let call2 = send_xcm_asset_hub(&context, vec![set_ethereum_fee]).await?; + utility_force_batch(vec![call1, call2]) } }; let preimage = call.encode(); + generate_chopsticks_script(&preimage, "chopsticks-execute-upgrade.js".into())?; + match cli.format { Format::Hex => { println!("0x{}", hex::encode(preimage)); - }, + } Format::Binary => { - std::io::stdout().write_all(&preimage).expect("write stdout"); + std::io::stdout().write_all(&preimage)?; } } diff --git a/control/preimage/src/relay_runtime.rs b/control/preimage/src/relay_runtime.rs index 95739b3357..9805d49ca8 100644 --- a/control/preimage/src/relay_runtime.rs +++ b/control/preimage/src/relay_runtime.rs @@ -1,2 +1,9 @@ #[cfg(feature = "rococo")] pub use rococo_runtime::*; +#[cfg(feature = "rococo")] +pub use rococo_runtime::runtime_types::rococo_runtime::RuntimeCall; + +#[cfg(feature = "polkadot")] +pub use polkadot_runtime::*; +#[cfg(feature = "polkadot")] +pub use polkadot_runtime::runtime_types::polkadot_runtime::RuntimeCall; diff --git a/control/preimage/templates/chopsticks-execute-upgrade.js.hbs b/control/preimage/templates/chopsticks-execute-upgrade.js.hbs new file mode 100644 index 0000000000..fe85354876 --- /dev/null +++ b/control/preimage/templates/chopsticks-execute-upgrade.js.hbs @@ -0,0 +1,44 @@ +/* eslint-disable no-use-before-define */ + +let blockNumber = (await api.rpc.chain.getHeader()).number.toNumber(); + +let storage = { + Preimage: { + PreimageFor: [[[["{{preimage.hash}}", {{preimage.size}}]], "{{preimage.bytes}}"]], + StatusFor: [ + [ + [preimage.hash], + { + Requested: { + count: 1, + len: {{preimage.size}}, + }, + }, + ], + ], + }, + Scheduler: { + Agenda: [ + [ + [blockNumber + 1], + [ + { + call: { + Lookup: { + hash: "{{preimage.hash}}", + len: {{preimage.size}}, + }, + }, + origin: { + system: "Root", + }, + }, + ], + ], + ], + }, +}; + +await api.rpc("dev_setStorage", storage); + +await api.rpc("dev_newBlock", { count: 2 }); diff --git a/control/runtimes/asset-hub-polkadot/Cargo.toml b/control/runtimes/asset-hub-polkadot/Cargo.toml new file mode 100644 index 0000000000..6b440e09e7 --- /dev/null +++ b/control/runtimes/asset-hub-polkadot/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "asset-hub-polkadot-runtime" +version = "0.1.0" +edition = "2021" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ + "derive", +] } +serde = { version = "1.0.197", features = ["derive"] } +subxt = { version = "0.35.1", features = ["substrate-compat"] } +sp-arithmetic = "24.0.0" diff --git a/control/runtimes/asset-hub-polkadot/asset-hub-metadata.bin b/control/runtimes/asset-hub-polkadot/asset-hub-metadata.bin new file mode 100644 index 0000000000..00eadf3a81 Binary files /dev/null and b/control/runtimes/asset-hub-polkadot/asset-hub-metadata.bin differ diff --git a/control/runtimes/asset-hub-polkadot/build.rs b/control/runtimes/asset-hub-polkadot/build.rs new file mode 100644 index 0000000000..1aaec9dcb5 --- /dev/null +++ b/control/runtimes/asset-hub-polkadot/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rerun-if-changed=asset-hub-metadata.bin"); +} diff --git a/control/runtimes/asset-hub-polkadot/src/lib.rs b/control/runtimes/asset-hub-polkadot/src/lib.rs new file mode 100644 index 0000000000..db14278410 --- /dev/null +++ b/control/runtimes/asset-hub-polkadot/src/lib.rs @@ -0,0 +1,7 @@ +#[subxt::subxt( + runtime_metadata_path = "asset-hub-metadata.bin", + derive_for_all_types = "Clone" +)] +mod runtime {} + +pub use runtime::*; diff --git a/control/runtimes/asset-hub-rococo/Cargo.toml b/control/runtimes/asset-hub-rococo/Cargo.toml new file mode 100644 index 0000000000..bf1ed5589f --- /dev/null +++ b/control/runtimes/asset-hub-rococo/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "asset-hub-rococo-runtime" +version = "0.1.0" +edition = "2021" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ + "derive", +] } +serde = { version = "1.0.197", features = ["derive"] } +subxt = { version = "0.35.1", features = ["substrate-compat"] } +sp-arithmetic = "24.0.0" diff --git a/control/runtimes/asset-hub-rococo/asset-hub-metadata.bin b/control/runtimes/asset-hub-rococo/asset-hub-metadata.bin new file mode 100644 index 0000000000..b1e12c5d6f Binary files /dev/null and b/control/runtimes/asset-hub-rococo/asset-hub-metadata.bin differ diff --git a/control/runtimes/asset-hub-rococo/build.rs b/control/runtimes/asset-hub-rococo/build.rs new file mode 100644 index 0000000000..1aaec9dcb5 --- /dev/null +++ b/control/runtimes/asset-hub-rococo/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rerun-if-changed=asset-hub-metadata.bin"); +} diff --git a/control/runtimes/asset-hub-rococo/src/lib.rs b/control/runtimes/asset-hub-rococo/src/lib.rs new file mode 100644 index 0000000000..db14278410 --- /dev/null +++ b/control/runtimes/asset-hub-rococo/src/lib.rs @@ -0,0 +1,7 @@ +#[subxt::subxt( + runtime_metadata_path = "asset-hub-metadata.bin", + derive_for_all_types = "Clone" +)] +mod runtime {} + +pub use runtime::*; diff --git a/control/runtimes/bridge-hub-polkadot/Cargo.toml b/control/runtimes/bridge-hub-polkadot/Cargo.toml new file mode 100644 index 0000000000..714b1c1f9b --- /dev/null +++ b/control/runtimes/bridge-hub-polkadot/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "bridge-hub-polkadot-runtime" +version = "0.1.0" +edition = "2021" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ + "derive", +] } +serde = { version = "1.0.197", features = ["derive"] } +subxt = { version = "0.35.1", features = ["substrate-compat"] } +snowbridge-beacon-primitives = "0.2.0" +sp-arithmetic = "24.0.0" diff --git a/control/runtimes/bridge-hub-polkadot/bridge-hub-metadata.bin b/control/runtimes/bridge-hub-polkadot/bridge-hub-metadata.bin new file mode 100644 index 0000000000..3d9098f460 Binary files /dev/null and b/control/runtimes/bridge-hub-polkadot/bridge-hub-metadata.bin differ diff --git a/control/runtimes/bridge-hub-polkadot/build.rs b/control/runtimes/bridge-hub-polkadot/build.rs new file mode 100644 index 0000000000..31865465d0 --- /dev/null +++ b/control/runtimes/bridge-hub-polkadot/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rerun-if-changed=bridge-hub-metadata.bin"); +} diff --git a/control/runtimes/bridge-hub-polkadot/src/lib.rs b/control/runtimes/bridge-hub-polkadot/src/lib.rs new file mode 100644 index 0000000000..a9a439716a --- /dev/null +++ b/control/runtimes/bridge-hub-polkadot/src/lib.rs @@ -0,0 +1,15 @@ +#[subxt::subxt( + runtime_metadata_path = "bridge-hub-metadata.bin", + derive_for_all_types = "Clone", + substitute_type( + path = "snowbridge_beacon_primitives::updates::CheckpointUpdate", + with = "::subxt::utils::Static<::snowbridge_beacon_primitives::updates::CheckpointUpdate<512>>", + ), + substitute_type( + path = "sp_arithmetic::fixed_point::FixedU128", + with = "::subxt::utils::Static<::sp_arithmetic::fixed_point::FixedU128>", + ) +)] +mod runtime {} + +pub use runtime::*; diff --git a/control/runtimes/bridge-hub-rococo/Cargo.toml b/control/runtimes/bridge-hub-rococo/Cargo.toml index 2f1f18294d..5dbd8bfeda 100644 --- a/control/runtimes/bridge-hub-rococo/Cargo.toml +++ b/control/runtimes/bridge-hub-rococo/Cargo.toml @@ -5,6 +5,10 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } -scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.9.0", default-features = false, features = [ + "derive", +] } serde = { version = "1.0.197", features = ["derive"] } -subxt = { version = "0.34.0", features = ["substrate-compat"] } +subxt = { version = "0.35.1", features = ["substrate-compat"] } +snowbridge-beacon-primitives = "0.2.0" +sp-arithmetic = "24.0.0" diff --git a/control/runtimes/bridge-hub-rococo/bridge-hub-metadata.bin b/control/runtimes/bridge-hub-rococo/bridge-hub-metadata.bin index 1eca8ab2a9..cb2937354b 100644 Binary files a/control/runtimes/bridge-hub-rococo/bridge-hub-metadata.bin and b/control/runtimes/bridge-hub-rococo/bridge-hub-metadata.bin differ diff --git a/control/runtimes/bridge-hub-rococo/build.rs b/control/runtimes/bridge-hub-rococo/build.rs new file mode 100644 index 0000000000..31865465d0 --- /dev/null +++ b/control/runtimes/bridge-hub-rococo/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rerun-if-changed=bridge-hub-metadata.bin"); +} diff --git a/control/runtimes/bridge-hub-rococo/src/lib.rs b/control/runtimes/bridge-hub-rococo/src/lib.rs index 894f6e62df..a9a439716a 100644 --- a/control/runtimes/bridge-hub-rococo/src/lib.rs +++ b/control/runtimes/bridge-hub-rococo/src/lib.rs @@ -1,6 +1,14 @@ #[subxt::subxt( runtime_metadata_path = "bridge-hub-metadata.bin", - derive_for_all_types = "Clone" + derive_for_all_types = "Clone", + substitute_type( + path = "snowbridge_beacon_primitives::updates::CheckpointUpdate", + with = "::subxt::utils::Static<::snowbridge_beacon_primitives::updates::CheckpointUpdate<512>>", + ), + substitute_type( + path = "sp_arithmetic::fixed_point::FixedU128", + with = "::subxt::utils::Static<::sp_arithmetic::fixed_point::FixedU128>", + ) )] mod runtime {} diff --git a/control/runtimes/polkadot/Cargo.toml b/control/runtimes/polkadot/Cargo.toml new file mode 100644 index 0000000000..26e82bc6e8 --- /dev/null +++ b/control/runtimes/polkadot/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "polkadot-runtime" +version = "0.1.0" +edition = "2021" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ + "derive", +] } +serde = { version = "1.0.197", features = ["derive"] } +subxt = { version = "0.34.0", features = ["substrate-compat"] } diff --git a/control/runtimes/polkadot/build.rs b/control/runtimes/polkadot/build.rs new file mode 100644 index 0000000000..d86c71c05c --- /dev/null +++ b/control/runtimes/polkadot/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rerun-if-changed=polkadot-metadata.bin"); +} diff --git a/control/runtimes/polkadot/polkadot-metadata.bin b/control/runtimes/polkadot/polkadot-metadata.bin new file mode 100644 index 0000000000..2a612b43a6 Binary files /dev/null and b/control/runtimes/polkadot/polkadot-metadata.bin differ diff --git a/control/runtimes/polkadot/src/lib.rs b/control/runtimes/polkadot/src/lib.rs new file mode 100644 index 0000000000..122d66008a --- /dev/null +++ b/control/runtimes/polkadot/src/lib.rs @@ -0,0 +1,7 @@ +#[subxt::subxt( + runtime_metadata_path = "polkadot-metadata.bin", + derive_for_all_types = "Clone" +)] +mod runtime {} + +pub use runtime::*; diff --git a/control/runtimes/rococo/build.rs b/control/runtimes/rococo/build.rs new file mode 100644 index 0000000000..d86c71c05c --- /dev/null +++ b/control/runtimes/rococo/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rerun-if-changed=polkadot-metadata.bin"); +} diff --git a/docs/architecture/components.md b/docs/architecture/components.md index 35121af97c..6c9e39add3 100644 --- a/docs/architecture/components.md +++ b/docs/architecture/components.md @@ -10,7 +10,7 @@ This [pallet](https://github.com/Snowfork/snowbridge/tree/main/parachain/pallets 1. Verifying that message[^1] that was included in the finalized Ethereum execution chain as tracked by our ethereum light client. 2. Converting the message to an [XCM](https://wiki.polkadot.network/docs/learn-xcm) script. -3. Sending the the XCM script to the destination parachain. +3. Sending the XCM script to the destination parachain. ### OutboundQueue diff --git a/docs/architecture/fees-and-channels.md b/docs/architecture/fees-and-channels.md index 2f28903540..4ba49a73a3 100644 --- a/docs/architecture/fees-and-channels.md +++ b/docs/architecture/fees-and-channels.md @@ -2,7 +2,7 @@ Bridge messages flow across the bridge through logical _channels_. Each parachain that wishes to directly send or receive messages is allocated its own dedicated channel, and has some influence over the operation of its channel. -This design ensures the the following: +This design ensures the following: * Parachain governance assumes the responsibility of [rebalancing](fees-and-channels.md#rebalancing) * The potential for custom fee/reward models on a per-channel basis @@ -27,7 +27,7 @@ As a prerequisite, the parachain must already have an agent instantiated on Ethe The net result is that: -* On Ethereum, the agent contract of the origin parachain is _credited_ with fees that cover the cost of delivery to the the destination parachain. +* On Ethereum, the agent contract of the origin parachain is _credited_ with fees that cover the cost of delivery to the destination parachain. * On BridgeHub, sovereign account of the origin parachain is _debited_ with the costs incurred for delivery. ### Parachain -> BridgeHub -> Ethereum diff --git a/docs/rococo-testnet/rococo-sepolia-token-transfers.md b/docs/rococo-testnet/rococo-sepolia-token-transfers.md index e5146ca29a..01d4ceb8a7 100644 --- a/docs/rococo-testnet/rococo-sepolia-token-transfers.md +++ b/docs/rococo-testnet/rococo-sepolia-token-transfers.md @@ -159,7 +159,7 @@ Gateway Contract Address: [0x5b4909ce6ca82d2ce23bd46738953c7959e710cd](https://s 1. Navigate to the Contract tab, click Read as Proxy. 2. Expand `quoteSendTokenFee` and input the token address. 3. The `destinationChain` that the token is going to be sent to. In this example it is destination parachain `2005`. -4. The `destinationFee` is the fee used by the destination chain to pay for XCM execution. This amount in in the unit of the relaychain native currency. Here we use `1,000,000 ROC CENTS` . (`1 MircroROC`) +4. The `destinationFee` is the fee used by the destination chain to pay for XCM execution. This amount in the unit of the relaychain native currency. Here we use `1,000,000 ROC CENTS` . (`1 MircroROC`) 5. Click query, the fee is returned in the unit `Wei`.
diff --git a/flake.nix b/flake.nix index e8b302ecaa..130e52fe92 100644 --- a/flake.nix +++ b/flake.nix @@ -86,7 +86,7 @@ export CARGO_HOME=$PWD/.cargo export RUSTUP_HOME=$PWD/.rustup - export RUST_NIGHTLY_VERSION=nightly-2023-12-28 + export RUST_NIGHTLY_VERSION=nightly-2024-02-08 export PATH=$CARGO_HOME/bin:$PATH eval "$(direnv hook bash)" diff --git a/relayer/cmd/store_beacon_state.go b/relayer/cmd/store_beacon_state.go index c88cc4248d..9e5468cce3 100644 --- a/relayer/cmd/store_beacon_state.go +++ b/relayer/cmd/store_beacon_state.go @@ -24,14 +24,8 @@ func storeBeaconState() *cobra.Command { RunE: storeBeaconStateInDB, } - cmd.Flags().String("url", "", "URL to generate test fixtures from") - err := cmd.MarkFlagRequired("url") - if err != nil { - return nil - } - - cmd.Flags().String("db-store-location", "", "where the database store file should be stored") - err = cmd.MarkFlagRequired("db-store-location") + cmd.Flags().String("config", "", "path to the beacon config file to use") + err := cmd.MarkFlagRequired("config") if err != nil { return nil } @@ -40,17 +34,12 @@ func storeBeaconState() *cobra.Command { } func storeBeaconStateInDB(cmd *cobra.Command, _ []string) error { - dbStoreLocation, err := cmd.Flags().GetString("db-store-location") - if err != nil { - return err - } - - url, err := cmd.Flags().GetString("url") + configFile, err := cmd.Flags().GetString("config") if err != nil { return err } - viper.SetConfigFile("web/packages/test/config/beacon-relay.json") + viper.SetConfigFile(configFile) if err := viper.ReadInConfig(); err != nil { return err } @@ -60,10 +49,10 @@ func storeBeaconStateInDB(cmd *cobra.Command, _ []string) error { return err } - store := store.New(dbStoreLocation, 100) + store := store.New(conf.Source.Beacon.DataStore.Location, conf.Source.Beacon.DataStore.MaxEntries) specSettings := conf.Source.Beacon.Spec - beaconClient := api.NewBeaconClient(url, specSettings.SlotsInEpoch) + beaconClient := api.NewBeaconClient(conf.Source.Beacon.Endpoint, specSettings.SlotsInEpoch) syncer := syncer.New(beaconClient, specSettings, &store) err = store.Connect() diff --git a/relayer/contracts/beefy_client.go b/relayer/contracts/beefy_client.go index 8e270483c5..3ab1bdb2ce 100644 --- a/relayer/contracts/beefy_client.go +++ b/relayer/contracts/beefy_client.go @@ -78,7 +78,7 @@ type Uint16Array struct { // BeefyClientMetaData contains all meta data concerning the BeefyClient contract. var BeefyClientMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_randaoCommitDelay\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_randaoCommitExpiration\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minNumRequiredSignatures\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_initialBeefyBlock\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_initialValidatorSet\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.ValidatorSet\",\"components\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_nextValidatorSet\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.ValidatorSet\",\"components\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MMR_ROOT_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitPrevRandao\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createFinalBitfield\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bitfield\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createInitialBitfield\",\"inputs\":[{\"name\":\"bitsToSet\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"currentValidatorSet\",\"inputs\":[],\"outputs\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"usageCounters\",\"type\":\"tuple\",\"internalType\":\"structUint16Array\",\"components\":[{\"name\":\"data\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestBeefyBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestMMRRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minNumRequiredSignatures\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nextValidatorSet\",\"inputs\":[],\"outputs\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"usageCounters\",\"type\":\"tuple\",\"internalType\":\"structUint16Array\",\"components\":[{\"name\":\"data\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"randaoCommitDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"randaoCommitExpiration\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submitFinal\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.Commitment\",\"components\":[{\"name\":\"blockNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"validatorSetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"payload\",\"type\":\"tuple[]\",\"internalType\":\"structBeefyClient.PayloadItem[]\",\"components\":[{\"name\":\"payloadID\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"bitfield\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"proofs\",\"type\":\"tuple[]\",\"internalType\":\"structBeefyClient.ValidatorProof[]\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}]},{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.MMRLeaf\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"parentNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"parentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"nextAuthoritySetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nextAuthoritySetLen\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"nextAuthoritySetRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"parachainHeadsRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"leafProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"leafProofOrder\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitInitial\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.Commitment\",\"components\":[{\"name\":\"blockNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"validatorSetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"payload\",\"type\":\"tuple[]\",\"internalType\":\"structBeefyClient.PayloadItem[]\",\"components\":[{\"name\":\"payloadID\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"bitfield\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"proof\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.ValidatorProof\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"tickets\",\"inputs\":[{\"name\":\"ticketID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"validatorSetLen\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"numRequiredSignatures\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"prevRandao\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bitfieldHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyMMRLeafProof\",\"inputs\":[{\"name\":\"leafHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"proofOrder\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"NewMMRRoot\",\"inputs\":[{\"name\":\"mmrRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CommitmentNotRelevant\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IndexOutOfBounds\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBitfield\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBitfieldLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCommitment\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMMRLeaf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMMRLeafProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMMRRootLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTicket\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidValidatorProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidValidatorProofLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotEnoughClaims\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrevRandaoAlreadyCaptured\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrevRandaoNotCaptured\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ProofSizeExceeded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StaleCommitment\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TicketExpired\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnsupportedCompactEncoding\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WaitPeriodNotOver\",\"inputs\":[]}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_randaoCommitDelay\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_randaoCommitExpiration\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minNumRequiredSignatures\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_initialBeefyBlock\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_initialValidatorSet\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.ValidatorSet\",\"components\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"_nextValidatorSet\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.ValidatorSet\",\"components\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MMR_ROOT_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitPrevRandao\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createFinalBitfield\",\"inputs\":[{\"name\":\"commitmentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"bitfield\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createInitialBitfield\",\"inputs\":[{\"name\":\"bitsToSet\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"currentValidatorSet\",\"inputs\":[],\"outputs\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"usageCounters\",\"type\":\"tuple\",\"internalType\":\"structUint16Array\",\"components\":[{\"name\":\"data\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestBeefyBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestMMRRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minNumRequiredSignatures\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nextValidatorSet\",\"inputs\":[],\"outputs\":[{\"name\":\"id\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"length\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"usageCounters\",\"type\":\"tuple\",\"internalType\":\"structUint16Array\",\"components\":[{\"name\":\"data\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"randaoCommitDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"randaoCommitExpiration\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submitFinal\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.Commitment\",\"components\":[{\"name\":\"blockNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"validatorSetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"payload\",\"type\":\"tuple[]\",\"internalType\":\"structBeefyClient.PayloadItem[]\",\"components\":[{\"name\":\"payloadID\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"bitfield\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"proofs\",\"type\":\"tuple[]\",\"internalType\":\"structBeefyClient.ValidatorProof[]\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}]},{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.MMRLeaf\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"parentNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"parentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"nextAuthoritySetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nextAuthoritySetLen\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"nextAuthoritySetRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"parachainHeadsRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"leafProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"leafProofOrder\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitInitial\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.Commitment\",\"components\":[{\"name\":\"blockNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"validatorSetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"payload\",\"type\":\"tuple[]\",\"internalType\":\"structBeefyClient.PayloadItem[]\",\"components\":[{\"name\":\"payloadID\",\"type\":\"bytes2\",\"internalType\":\"bytes2\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"bitfield\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"proof\",\"type\":\"tuple\",\"internalType\":\"structBeefyClient.ValidatorProof\",\"components\":[{\"name\":\"v\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"r\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"tickets\",\"inputs\":[{\"name\":\"ticketID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"blockNumber\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"validatorSetLen\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"numRequiredSignatures\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"prevRandao\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"bitfieldHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyMMRLeafProof\",\"inputs\":[{\"name\":\"leafHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"proofOrder\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"NewMMRRoot\",\"inputs\":[{\"name\":\"mmrRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTicket\",\"inputs\":[{\"name\":\"relayer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"blockNumber\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CommitmentNotRelevant\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IndexOutOfBounds\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBitfield\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBitfieldLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCommitment\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMMRLeaf\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMMRLeafProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMMRRootLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTicket\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidValidatorProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidValidatorProofLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotEnoughClaims\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrevRandaoAlreadyCaptured\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PrevRandaoNotCaptured\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ProofSizeExceeded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StaleCommitment\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TicketExpired\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnsupportedCompactEncoding\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WaitPeriodNotOver\",\"inputs\":[]}]", } // BeefyClientABI is the input ABI used to generate the binding from. @@ -873,3 +873,138 @@ func (_BeefyClient *BeefyClientFilterer) ParseNewMMRRoot(log types.Log) (*BeefyC event.Raw = log return event, nil } + +// BeefyClientNewTicketIterator is returned from FilterNewTicket and is used to iterate over the raw logs and unpacked data for NewTicket events raised by the BeefyClient contract. +type BeefyClientNewTicketIterator struct { + Event *BeefyClientNewTicket // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BeefyClientNewTicketIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BeefyClientNewTicket) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BeefyClientNewTicket) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BeefyClientNewTicketIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BeefyClientNewTicketIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BeefyClientNewTicket represents a NewTicket event raised by the BeefyClient contract. +type BeefyClientNewTicket struct { + Relayer common.Address + BlockNumber uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewTicket is a free log retrieval operation binding the contract event 0xbee983fc706c692efb9b0240bddc5666c010a53af55ed5fb42d226e7e4293869. +// +// Solidity: event NewTicket(address relayer, uint64 blockNumber) +func (_BeefyClient *BeefyClientFilterer) FilterNewTicket(opts *bind.FilterOpts) (*BeefyClientNewTicketIterator, error) { + + logs, sub, err := _BeefyClient.contract.FilterLogs(opts, "NewTicket") + if err != nil { + return nil, err + } + return &BeefyClientNewTicketIterator{contract: _BeefyClient.contract, event: "NewTicket", logs: logs, sub: sub}, nil +} + +// WatchNewTicket is a free log subscription operation binding the contract event 0xbee983fc706c692efb9b0240bddc5666c010a53af55ed5fb42d226e7e4293869. +// +// Solidity: event NewTicket(address relayer, uint64 blockNumber) +func (_BeefyClient *BeefyClientFilterer) WatchNewTicket(opts *bind.WatchOpts, sink chan<- *BeefyClientNewTicket) (event.Subscription, error) { + + logs, sub, err := _BeefyClient.contract.WatchLogs(opts, "NewTicket") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BeefyClientNewTicket) + if err := _BeefyClient.contract.UnpackLog(event, "NewTicket", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNewTicket is a log parse operation binding the contract event 0xbee983fc706c692efb9b0240bddc5666c010a53af55ed5fb42d226e7e4293869. +// +// Solidity: event NewTicket(address relayer, uint64 blockNumber) +func (_BeefyClient *BeefyClientFilterer) ParseNewTicket(log types.Log) (*BeefyClientNewTicket, error) { + event := new(BeefyClientNewTicket) + if err := _BeefyClient.contract.UnpackLog(event, "NewTicket", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/relayer/contracts/gateway.go b/relayer/contracts/gateway.go index c1e6dba905..2983f835c4 100644 --- a/relayer/contracts/gateway.go +++ b/relayer/contracts/gateway.go @@ -97,7 +97,7 @@ type Weight struct { // GatewayMetaData contains all meta data concerning the Gateway contract. var GatewayMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"agentOf\",\"inputs\":[{\"name\":\"agentID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"channelNoncesOf\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"internalType\":\"ChannelID\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"channelOperatingModeOf\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"internalType\":\"ChannelID\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumOperatingMode\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"implementation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isTokenRegistered\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatingMode\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumOperatingMode\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pricingParameters\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"UD60x18\"},{\"name\":\"\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"quoteRegisterTokenFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"quoteSendCallFee\",\"inputs\":[{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"quoteSendTokenFee\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationChain\",\"type\":\"uint32\",\"internalType\":\"ParaID\"},{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerToken\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"sendCall\",\"inputs\":[{\"name\":\"destinationChain\",\"type\":\"uint32\",\"internalType\":\"ParaID\"},{\"name\":\"originKind\",\"type\":\"uint8\",\"internalType\":\"enumOriginKind\"},{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"weightAtMost\",\"type\":\"tuple\",\"internalType\":\"structWeight\",\"components\":[{\"name\":\"refTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proofSize\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"call\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"sendToken\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationChain\",\"type\":\"uint32\",\"internalType\":\"ParaID\"},{\"name\":\"destinationAddress\",\"type\":\"tuple\",\"internalType\":\"structMultiAddress\",\"components\":[{\"name\":\"kind\",\"type\":\"uint8\",\"internalType\":\"enumKind\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"amount\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"submitV1\",\"inputs\":[{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structInboundMessage\",\"components\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"internalType\":\"ChannelID\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"command\",\"type\":\"uint8\",\"internalType\":\"enumCommand\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"maxDispatchGas\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maxFeePerGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"reward\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"leafProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"headerProof\",\"type\":\"tuple\",\"internalType\":\"structVerification.Proof\",\"components\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structVerification.ParachainHeader\",\"components\":[{\"name\":\"parentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"number\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"stateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"extrinsicsRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"digestItems\",\"type\":\"tuple[]\",\"internalType\":\"structVerification.DigestItem[]\",\"components\":[{\"name\":\"kind\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"consensusEngineID\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"headProof\",\"type\":\"tuple\",\"internalType\":\"structVerification.HeadProof\",\"components\":[{\"name\":\"pos\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"width\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}]},{\"name\":\"leafPartial\",\"type\":\"tuple\",\"internalType\":\"structVerification.MMRLeafPartial\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"parentNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"parentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"nextAuthoritySetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nextAuthoritySetLen\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"nextAuthoritySetRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"leafProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"leafProofOrder\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AgentCreated\",\"inputs\":[{\"name\":\"agentID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"agent\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AgentFundsWithdrawn\",\"inputs\":[{\"name\":\"agentID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelCreated\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpdated\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InboundMessageDispatched\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"messageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"success\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatingModeChanged\",\"inputs\":[{\"name\":\"mode\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumOperatingMode\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OutboundMessageAccepted\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"messageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"payload\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PricingParametersChanged\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenRegistrationSent\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenSent\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"destinationChain\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"ParaID\"},{\"name\":\"destinationAddress\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structMultiAddress\",\"components\":[{\"name\":\"kind\",\"type\":\"uint8\",\"internalType\":\"enumKind\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"amount\",\"type\":\"uint128\",\"indexed\":false,\"internalType\":\"uint128\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeesChanged\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + ABI: "[{\"type\":\"function\",\"name\":\"agentOf\",\"inputs\":[{\"name\":\"agentID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"channelNoncesOf\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"internalType\":\"ChannelID\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"channelOperatingModeOf\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"internalType\":\"ChannelID\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumOperatingMode\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"implementation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isTokenRegistered\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatingMode\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumOperatingMode\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pricingParameters\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"UD60x18\"},{\"name\":\"\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"quoteRegisterTokenFee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"quoteSendCallFee\",\"inputs\":[{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"quoteSendTokenFee\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationChain\",\"type\":\"uint32\",\"internalType\":\"ParaID\"},{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerToken\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"sendCall\",\"inputs\":[{\"name\":\"destinationChain\",\"type\":\"uint32\",\"internalType\":\"ParaID\"},{\"name\":\"originKind\",\"type\":\"uint8\",\"internalType\":\"enumOriginKind\"},{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"weightAtMost\",\"type\":\"tuple\",\"internalType\":\"structWeight\",\"components\":[{\"name\":\"refTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proofSize\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"call\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"sendToken\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationChain\",\"type\":\"uint32\",\"internalType\":\"ParaID\"},{\"name\":\"destinationAddress\",\"type\":\"tuple\",\"internalType\":\"structMultiAddress\",\"components\":[{\"name\":\"kind\",\"type\":\"uint8\",\"internalType\":\"enumKind\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"destinationFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"amount\",\"type\":\"uint128\",\"internalType\":\"uint128\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"submitV1\",\"inputs\":[{\"name\":\"message\",\"type\":\"tuple\",\"internalType\":\"structInboundMessage\",\"components\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"internalType\":\"ChannelID\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"command\",\"type\":\"uint8\",\"internalType\":\"enumCommand\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"maxDispatchGas\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maxFeePerGas\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"reward\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"leafProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"headerProof\",\"type\":\"tuple\",\"internalType\":\"structVerification.Proof\",\"components\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structVerification.ParachainHeader\",\"components\":[{\"name\":\"parentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"number\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"stateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"extrinsicsRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"digestItems\",\"type\":\"tuple[]\",\"internalType\":\"structVerification.DigestItem[]\",\"components\":[{\"name\":\"kind\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"consensusEngineID\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"headProof\",\"type\":\"tuple\",\"internalType\":\"structVerification.HeadProof\",\"components\":[{\"name\":\"pos\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"width\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}]},{\"name\":\"leafPartial\",\"type\":\"tuple\",\"internalType\":\"structVerification.MMRLeafPartial\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"parentNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"parentHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"nextAuthoritySetID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nextAuthoritySetLen\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"nextAuthoritySetRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"leafProof\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"leafProofOrder\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AgentCreated\",\"inputs\":[{\"name\":\"agentID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"agent\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AgentFundsWithdrawn\",\"inputs\":[{\"name\":\"agentID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelCreated\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpdated\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InboundMessageDispatched\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"messageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"success\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatingModeChanged\",\"inputs\":[{\"name\":\"mode\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumOperatingMode\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OutboundMessageAccepted\",\"inputs\":[{\"name\":\"channelID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"ChannelID\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"messageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"payload\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PricingParametersChanged\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenRegistrationSent\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenSent\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"destinationChain\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"ParaID\"},{\"name\":\"destinationAddress\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structMultiAddress\",\"components\":[{\"name\":\"kind\",\"type\":\"uint8\",\"internalType\":\"enumKind\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"amount\",\"type\":\"uint128\",\"indexed\":false,\"internalType\":\"uint128\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenTransferFeesChanged\",\"inputs\":[],\"anonymous\":false}]", } // GatewayABI is the input ABI used to generate the binding from. @@ -2230,147 +2230,3 @@ func (_Gateway *GatewayFilterer) ParseTokenTransferFeesChanged(log types.Log) (* event.Raw = log return event, nil } - -// GatewayUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the Gateway contract. -type GatewayUpgradedIterator struct { - Event *GatewayUpgraded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *GatewayUpgradedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(GatewayUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(GatewayUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *GatewayUpgradedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *GatewayUpgradedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// GatewayUpgraded represents a Upgraded event raised by the Gateway contract. -type GatewayUpgraded struct { - Implementation common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_Gateway *GatewayFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*GatewayUpgradedIterator, error) { - - var implementationRule []interface{} - for _, implementationItem := range implementation { - implementationRule = append(implementationRule, implementationItem) - } - - logs, sub, err := _Gateway.contract.FilterLogs(opts, "Upgraded", implementationRule) - if err != nil { - return nil, err - } - return &GatewayUpgradedIterator{contract: _Gateway.contract, event: "Upgraded", logs: logs, sub: sub}, nil -} - -// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_Gateway *GatewayFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *GatewayUpgraded, implementation []common.Address) (event.Subscription, error) { - - var implementationRule []interface{} - for _, implementationItem := range implementation { - implementationRule = append(implementationRule, implementationItem) - } - - logs, sub, err := _Gateway.contract.WatchLogs(opts, "Upgraded", implementationRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(GatewayUpgraded) - if err := _Gateway.contract.UnpackLog(event, "Upgraded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_Gateway *GatewayFilterer) ParseUpgraded(log types.Log) (*GatewayUpgraded, error) { - event := new(GatewayUpgraded) - if err := _Gateway.contract.UnpackLog(event, "Upgraded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/relayer/crypto/merkle/merkle.go b/relayer/crypto/merkle/merkle.go index af0040e215..b3143d7c5b 100644 --- a/relayer/crypto/merkle/merkle.go +++ b/relayer/crypto/merkle/merkle.go @@ -141,7 +141,7 @@ func (t *Tree) MerklePath(preLeaf []byte) []*Node { remainder := levelLen % 2 nextIndex := index / 2 - // if index is the the last item in an odd length level promote + // if index is the last item in an odd length level promote if index == levelLen-1 && remainder != 0 { index = nextIndex continue diff --git a/smoketest/Cargo.lock b/smoketest/Cargo.lock index 47cb426d7b..3d39e0475d 100644 --- a/smoketest/Cargo.lock +++ b/smoketest/Cargo.lock @@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -63,7 +63,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.12", + "getrandom", "once_cell", "version_check", ] @@ -75,7 +75,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", - "getrandom 0.2.12", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -252,7 +252,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.5", + "rand", ] [[package]] @@ -276,29 +276,12 @@ dependencies = [ "nodrop", ] -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "2.1.1" @@ -321,41 +304,20 @@ dependencies = [ "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand", + "futures-lite", "slab", ] [[package]] name = "async-fs" -version = "1.6.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +checksum = "bc19683171f287921f2405677dd2ed2549c3b3bda697a563ebc3a121ace2aba1" dependencies = [ - "async-lock 2.8.0", - "autocfg", + "async-lock 3.3.0", "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", + "futures-lite", ] [[package]] @@ -368,9 +330,9 @@ dependencies = [ "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite", "parking", - "polling 3.4.0", + "polling", "rustix 0.38.31", "slab", "tracing", @@ -399,30 +361,33 @@ dependencies = [ [[package]] name = "async-net" -version = "1.8.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io 1.13.0", + "async-io", "blocking", - "futures-lite 1.13.0", + "futures-lite", ] [[package]] name = "async-process" -version = "1.8.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +checksum = "d999d925640d51b662b7b4e404224dd81de70f4aa4a199383c2c5e5b86885fa3" dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", + "async-channel", + "async-io", + "async-lock 3.3.0", "async-signal", + "async-task", "blocking", "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", + "event-listener 5.3.0", + "futures-lite", "rustix 0.38.31", - "windows-sys 0.48.0", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -431,7 +396,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.3.1", + "async-io", "async-lock 2.8.0", "atomic-waker", "cfg-if", @@ -539,6 +504,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "base64ct" version = "1.6.0" @@ -575,19 +546,33 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", - "rand 0.8.5", - "rand_core 0.6.4", + "bitcoin_hashes 0.11.0", "serde", "unicode-normalization", ] +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -642,25 +627,13 @@ dependencies = [ "constant_time_eq 0.3.0", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -669,16 +642,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -687,28 +651,16 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 2.1.1", + "async-channel", "async-lock 3.3.0", "async-task", - "fastrand 2.0.1", + "fastrand", "futures-io", - "futures-lite 2.2.0", + "futures-lite", "piper", "tracing", ] -[[package]] -name = "bounded-collections" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" -dependencies = [ - "log", - "parity-scale-codec", - "scale-info", - "serde", -] - [[package]] name = "bounded-collections" version = "0.2.0" @@ -743,12 +695,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "byteorder" version = "1.5.0" @@ -871,7 +817,7 @@ dependencies = [ "hmac 0.12.1", "once_cell", "pbkdf2 0.12.2", - "rand 0.8.5", + "rand", "sha2 0.10.8", "thiserror", ] @@ -886,7 +832,7 @@ dependencies = [ "bech32", "bs58", "digest 0.10.7", - "generic-array 0.14.7", + "generic-array", "hex", "ripemd", "serde", @@ -1033,7 +979,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array 0.14.7", + "generic-array", "rand_core 0.6.4", "subtle", "zeroize", @@ -1045,7 +991,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", + "generic-array", "rand_core 0.6.4", "typenum", ] @@ -1056,17 +1002,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.7", - "subtle", -] - -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array 0.14.7", + "generic-array", "subtle", ] @@ -1079,19 +1015,6 @@ dependencies = [ "cipher", ] -[[package]] -name = "curve25519-dalek" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -1145,12 +1068,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.5" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core 0.20.5", - "darling_macro 0.20.5", + "darling_core 0.20.8", + "darling_macro 0.20.8", ] [[package]] @@ -1169,9 +1092,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.5" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", @@ -1194,11 +1117,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.5" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core 0.20.5", + "darling_core 0.20.8", "quote", "syn 2.0.58", ] @@ -1263,22 +1186,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -1369,6 +1283,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -1428,9 +1343,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elliptic-curve" @@ -1442,11 +1357,12 @@ dependencies = [ "crypto-bigint", "digest 0.10.7", "ff", - "generic-array 0.14.7", + "generic-array", "group", "pkcs8", "rand_core 0.6.4", "sec1", + "serdect", "subtle", "zeroize", ] @@ -1471,7 +1387,7 @@ dependencies = [ "hex", "k256", "log", - "rand 0.8.5", + "rand", "rlp", "serde", "sha3", @@ -1512,7 +1428,7 @@ dependencies = [ "hex", "hmac 0.12.1", "pbkdf2 0.11.0", - "rand 0.8.5", + "rand", "scrypt", "serde", "serde_json", @@ -1660,12 +1576,12 @@ dependencies = [ "const-hex", "elliptic-curve", "ethabi", - "generic-array 0.14.7", + "generic-array", "k256", "num_enum", "once_cell", "open-fastrlp", - "rand 0.8.5", + "rand", "rlp", "serde", "serde_json", @@ -1751,7 +1667,7 @@ dependencies = [ "elliptic-curve", "eth-keystore", "ethers-core", - "rand 0.8.5", + "rand", "sha2 0.10.8", "thiserror", "tracing", @@ -1765,9 +1681,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -1776,9 +1692,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.3" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" dependencies = [ "concurrent-queue", "parking", @@ -1795,6 +1711,20 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "expander" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e83c02035136f1592a47964ea60c05a50e4ed8b5892cfac197063850898d4d" +dependencies = [ + "blake2", + "fs-err", + "prettier-please", + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "eyre" version = "0.6.12" @@ -1805,27 +1735,12 @@ dependencies = [ "once_cell", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fallible-iterator" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.1" @@ -1855,7 +1770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -1898,6 +1813,15 @@ dependencies = [ "serde", ] +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + [[package]] name = "funty" version = "2.0.0" @@ -1953,28 +1877,13 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ - "fastrand 2.0.1", + "fastrand", "futures-core", "futures-io", "parking", @@ -2051,15 +1960,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2071,17 +1971,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.12" @@ -2090,7 +1979,7 @@ checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -2099,7 +1988,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "rand 0.8.5", + "rand", "rand_core 0.6.4", ] @@ -2233,6 +2122,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" + [[package]] name = "hex-literal" version = "0.4.1" @@ -2245,17 +2140,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.0", + "crypto-mac", "digest 0.9.0", ] @@ -2275,7 +2160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.7", + "generic-array", "hmac 0.8.1", ] @@ -2330,7 +2215,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio", "tower-service", "tracing", @@ -2347,10 +2232,10 @@ dependencies = [ "http", "hyper", "log", - "rustls", - "rustls-native-certs", + "rustls 0.21.10", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -2469,7 +2354,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -2518,9 +2403,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -2542,9 +2427,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.20.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" +checksum = "c4b0e68d9af1f066c06d6e2397583795b912d78537d7d907c561e82c13d69fa1" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -2554,19 +2439,20 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.20.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +checksum = "92f254f56af1ae84815b9b1325094743dcf05b92abb5e94da2e81a35cff0cada" dependencies = [ "futures-util", "http", "jsonrpsee-core", "pin-project", - "rustls-native-certs", + "rustls-native-certs 0.7.0", + "rustls-pki-types", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-util", "tracing", "url", @@ -2574,31 +2460,32 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.20.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +checksum = "274d68152c24aa78977243bb56f28d7946e6aa309945b37d33174a3f92d89a3a" dependencies = [ "anyhow", - "async-lock 2.8.0", "async-trait", "beef", "futures-timer", "futures-util", "hyper", "jsonrpsee-types", + "pin-project", "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tokio-stream", "tracing", ] [[package]] name = "jsonrpsee-http-client" -version = "0.20.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" +checksum = "ac13bc1e44cd00448a5ff485824a128629c945f02077804cb659c07a0ba41395" dependencies = [ "async-trait", "hyper", @@ -2616,16 +2503,15 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.20.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +checksum = "3dc828e537868d6b12bbb07ec20324909a22ced6efca0057c825c3e1126b2c6d" dependencies = [ "anyhow", "beef", "serde", "serde_json", "thiserror", - "tracing", ] [[package]] @@ -2652,6 +2538,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", "signature", ] @@ -2696,7 +2583,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.5", + "rand", "serde", "sha2 0.9.9", "typenum", @@ -2737,12 +2624,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2825,18 +2706,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "merlin" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - [[package]] name = "merlin" version = "3.0.0" @@ -2877,7 +2746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -3026,12 +2895,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "opaque-debug" version = "0.3.0" @@ -3069,6 +2932,19 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -3126,19 +3002,21 @@ dependencies = [ ] [[package]] -name = "paste" -version = "1.0.14" +name = "password-hash" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] [[package]] -name = "pbkdf2" -version = "0.8.0" +name = "paste" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "crypto-mac 0.11.0", -] +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" @@ -3157,6 +3035,7 @@ checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", "hmac 0.12.1", + "password-hash", ] [[package]] @@ -3223,7 +3102,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand", "futures-io", ] @@ -3244,19 +3123,77 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] -name = "polling" -version = "2.8.0" +name = "polkavm-common" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" + +[[package]] +name = "polkavm-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" + +[[package]] +name = "polkavm-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", + "polkavm-derive-impl-macro 0.8.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +dependencies = [ + "polkavm-derive-impl-macro 0.9.0", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" +dependencies = [ + "polkavm-common 0.8.0", + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +dependencies = [ + "polkavm-common 0.9.0", + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +dependencies = [ + "polkavm-derive-impl 0.8.0", + "syn 2.0.58", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +dependencies = [ + "polkavm-derive-impl 0.9.0", + "syn 2.0.58", ] [[package]] @@ -3280,7 +3217,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", - "opaque-debug 0.3.0", + "opaque-debug", "universal-hash", ] @@ -3296,6 +3233,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettier-please" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" +dependencies = [ + "proc-macro2", + "syn 2.0.58", +] + [[package]] name = "prettyplease" version = "0.2.16" @@ -3374,9 +3321,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -3390,8 +3337,8 @@ dependencies = [ "bitflags 2.4.2", "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_xorshift", "regex-syntax 0.8.2", "unarray", @@ -3421,19 +3368,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -3441,20 +3375,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", + "rand_chacha", "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - [[package]] name = "rand_chacha" version = "0.3.1" @@ -3470,9 +3394,6 @@ name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] [[package]] name = "rand_core" @@ -3480,16 +3401,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -3642,7 +3554,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.12", + "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -3721,20 +3633,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.31" @@ -3756,10 +3654,24 @@ checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring 0.17.7", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +dependencies = [ + "log", + "ring 0.17.7", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -3767,7 +3679,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -3781,6 +3706,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.0", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -3791,6 +3732,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring 0.17.7", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -3834,38 +3786,38 @@ dependencies = [ [[package]] name = "scale-bits" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" +checksum = "662d10dcd57b1c2a3c41c9cf68f71fb09747ada1ea932ad961aca7e2ca28315f" dependencies = [ "parity-scale-codec", "scale-info", + "scale-type-resolver", "serde", ] [[package]] name = "scale-decode" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" +checksum = "afc79ba56a1c742f5aeeed1f1801f3edf51f7e818f0a54582cac6f131364ea7b" dependencies = [ "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode-derive", - "scale-info", + "scale-type-resolver", "smallvec", ] [[package]] name = "scale-decode-derive" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" +checksum = "5398fdb3c7bea3cb419bac4983aadacae93fe1a7b5f693f4ebd98c3821aad7a5" dependencies = [ "darling 0.14.4", - "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -3873,24 +3825,24 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" +checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" dependencies = [ "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-encode-derive", - "scale-info", + "scale-type-resolver", "smallvec", ] [[package]] name = "scale-encode-derive" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" +checksum = "7a304e1af7cdfbe7a24e08b012721456cc8cecdedadc14b3d10513eada63233c" dependencies = [ "darling 0.14.4", "proc-macro-crate 1.3.1", @@ -3901,9 +3853,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" dependencies = [ "bitvec", "cfg-if", @@ -3915,9 +3867,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -3925,11 +3877,34 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-type-resolver" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10b800069bfd43374e0f96f653e0d46882a2cb16d6d961ac43bea80f26c76843" +dependencies = [ + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-typegen" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d470fa75e71b12b3244a4113adc4bc49891f3daba2054703cacd06256066397e" +dependencies = [ + "proc-macro2", + "quote", + "scale-info", + "syn 2.0.58", + "thiserror", +] + [[package]] name = "scale-value" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" +checksum = "c07ccfee963104335c971aaf8b7b0e749be8569116322df23f1f75c4ca9e4a28" dependencies = [ "base58", "blake2", @@ -3941,6 +3916,7 @@ dependencies = [ "scale-decode", "scale-encode", "scale-info", + "scale-type-resolver", "serde", "yap", ] @@ -3965,24 +3941,6 @@ dependencies = [ "hashbrown 0.13.2", ] -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin 2.0.1", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle", - "zeroize", -] - [[package]] name = "schnorrkel" version = "0.11.4" @@ -3994,7 +3952,7 @@ dependencies = [ "arrayvec 0.7.4", "curve25519-dalek 4.1.1", "getrandom_or_panic", - "merlin 3.0.0", + "merlin", "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", @@ -4038,37 +3996,20 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array 0.14.7", + "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] -[[package]] -name = "secp256k1" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" -dependencies = [ - "secp256k1-sys 0.6.1", -] - [[package]] name = "secp256k1" version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ - "secp256k1-sys 0.9.2", -] - -[[package]] -name = "secp256k1-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" -dependencies = [ - "cc", + "secp256k1-sys", ] [[package]] @@ -4164,9 +4105,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -4194,6 +4135,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha-1" version = "0.9.8" @@ -4204,7 +4155,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -4218,18 +4169,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha2" version = "0.9.9" @@ -4240,7 +4179,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -4292,6 +4231,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "simple-mermaid" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" + [[package]] name = "simple_asn1" version = "0.6.2" @@ -4327,26 +4272,26 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smol" -version = "1.3.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" +checksum = "e635339259e51ef85ac7aa29a1cd991b957047507288697a690e80ab97d07cad" dependencies = [ - "async-channel 1.9.0", + "async-channel", "async-executor", "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", + "async-io", + "async-lock 3.3.0", "async-net", "async-process", "blocking", - "futures-lite 1.13.0", + "futures-lite", ] [[package]] name = "smoldot" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca99148e026936bbc444c3708748207033968e4ef1c33bfc885660ae4d44d21" +checksum = "e6d1eaa97d77be4d026a1e7ffad1bb3b78448763b357ea6f8188d3e6f736a9b9" dependencies = [ "arrayvec 0.7.4", "async-lock 3.3.0", @@ -4360,17 +4305,17 @@ dependencies = [ "derive_more", "ed25519-zebra 4.0.3", "either", - "event-listener 3.1.0", + "event-listener 4.0.3", "fnv", - "futures-lite 2.2.0", + "futures-lite", "futures-util", "hashbrown 0.14.3", "hex", "hmac 0.12.1", - "itertools 0.11.0", + "itertools 0.12.1", "libm", "libsecp256k1", - "merlin 3.0.0", + "merlin", "no-std-net", "nom", "num-bigint", @@ -4379,10 +4324,10 @@ dependencies = [ "pbkdf2 0.12.2", "pin-project", "poly1305", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "ruzstd", - "schnorrkel 0.11.4", + "schnorrkel", "serde", "serde_json", "sha2 0.10.8", @@ -4399,31 +4344,31 @@ dependencies = [ [[package]] name = "smoldot-light" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e6f1898682b618b81570047b9d870b3faaff6ae1891b468eddd94d7f903c2fe" +checksum = "5496f2d116b7019a526b1039ec2247dd172b8670633b1a64a614c9ea12c9d8c7" dependencies = [ - "async-channel 2.1.1", + "async-channel", "async-lock 3.3.0", "base64 0.21.7", "blake2-rfc", "derive_more", "either", - "event-listener 3.1.0", + "event-listener 4.0.3", "fnv", "futures-channel", - "futures-lite 2.2.0", + "futures-lite", "futures-util", "hashbrown 0.14.3", "hex", - "itertools 0.11.0", + "itertools 0.12.1", "log", "lru", "no-std-net", "parking_lot", "pin-project", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "serde", "serde_json", "siphasher", @@ -4453,16 +4398,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -4484,64 +4419,63 @@ dependencies = [ "futures", "httparse", "log", - "rand 0.8.5", + "rand", "sha-1", ] [[package]] name = "sp-application-crypto" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23030de8eae0272c705cf3e2ce0523a64708a6b53aa23f3cf9053ca63abd08d7" +checksum = "13ca6121c22c8bd3d1dce1f05c479101fd0d7b159bef2a3e8c834138d839c75c" dependencies = [ "parity-scale-codec", "scale-info", "serde", "sp-core", "sp-io", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sp-arithmetic" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9cf6e5c0c7c2e7be3a4a10af5316d2d40182915509a70f632a66c238a05c37b" +version = "23.0.0" dependencies = [ + "docify", "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 12.0.0", + "sp-std 14.0.0", "static_assertions", ] [[package]] name = "sp-arithmetic" -version = "23.0.0" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" dependencies = [ - "docify", "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 14.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "static_assertions", ] [[package]] name = "sp-core" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0db34a19be2efa0398a9506a365392d93a85220856d55e0eb78165ad2e1bedc" +checksum = "26d7a0fd8f16dcc3761198fc83be12872f823b37b749bc72a3a6a1f702509366" dependencies = [ "array-bytes", - "bip39", "bitflags 1.3.2", "blake2", - "bounded-collections 0.1.9", + "bounded-collections", "bs58", "dyn-clonable", "ed25519-zebra 3.1.0", @@ -4550,26 +4484,26 @@ dependencies = [ "hash256-std-hasher", "impl-serde", "itertools 0.10.5", - "lazy_static", + "k256", "libsecp256k1", "log", - "merlin 2.0.1", + "merlin", + "parity-bip39", "parity-scale-codec", "parking_lot", "paste", "primitive-types", - "rand 0.8.5", - "regex", + "rand", "scale-info", - "schnorrkel 0.9.1", - "secp256k1 0.24.3", + "schnorrkel", + "secp256k1", "secrecy", "serde", - "sp-core-hashing", - "sp-debug-derive 12.0.0", + "sp-crypto-hashing", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-externalities", "sp-runtime-interface", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage", "ss58-registry", "substrate-bip39", @@ -4580,10 +4514,10 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing" -version = "13.0.0" +name = "sp-crypto-hashing" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" dependencies = [ "blake2b_simd", "byteorder", @@ -4595,9 +4529,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50535e1a5708d3ba5c1195b59ebefac61cc8679c2c24716b87a86e8b7ed2e4a1" +version = "14.0.0" dependencies = [ "proc-macro2", "quote", @@ -4607,6 +4539,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", @@ -4615,35 +4549,37 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.23.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884d05160bc89d0943d1c9fb8006c3d44b80f37f8af607aeff8d4d9cc82e279a" +checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage", ] [[package]] name = "sp-io" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301c0ce94f80b324465a6f6173183aa07b26bd71d67f94a44de1fd11dea4a7cb" +checksum = "3e09bba780b55bd9e67979cd8f654a31e4a6cf45426ff371394a65953d2177f2" dependencies = [ "bytes", "ed25519-dalek", "libsecp256k1", "log", "parity-scale-codec", + "polkavm-derive 0.9.1", "rustversion", - "secp256k1 0.24.3", + "secp256k1", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-keystore", "sp-runtime-interface", "sp-state-machine", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-tracing", "sp-trie", "tracing", @@ -4652,22 +4588,21 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.32.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db18ab01b2684856904c973d2be7dbf9ab3607cf706a7bd6648812662e5e7c5" +checksum = "bdbab8b61bd61d5f8625a0c75753b5d5a23be55d3445419acd42caf59cf6236b" dependencies = [ "parity-scale-codec", "parking_lot", "sp-core", "sp-externalities", - "thiserror", ] [[package]] name = "sp-panic-handler" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00e40857ed3e0187f145b037c733545c5633859f1bd1d1b09deb52805fa696a" +checksum = "d8f5a17a0a11de029a8b811cb6e8b32ce7e02183cc04a3e965c383246798c416" dependencies = [ "backtrace", "lazy_static", @@ -4676,40 +4611,43 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "29.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082bae4a164b8b629ce9cee79ff3c6b20e66d11d8ef37398796567d616325da4" +checksum = "ec3cb126971e7db2f0fcf8053dce740684c438c7180cfca1959598230f342c58" dependencies = [ + "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", "log", "parity-scale-codec", "paste", - "rand 0.8.5", + "rand", "scale-info", "serde", + "simple-mermaid", "sp-application-crypto", - "sp-arithmetic 21.0.0", + "sp-arithmetic 25.0.0", "sp-core", "sp-io", - "sp-std 12.0.0", - "sp-weights 25.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 30.0.0", ] [[package]] name = "sp-runtime-interface" -version = "22.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695bba5d981a6fd3131b098d65f620601bd822501612bfb65897d4bb660762b1" +checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", + "polkavm-derive 0.8.0", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -4718,12 +4656,13 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "15.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2afcbd1bd18d323371111b66b7ac2870bdc1c86c3d7b0dae67b112ca52b4d8" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", - "proc-macro-crate 1.3.1", + "expander", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.58", @@ -4731,20 +4670,20 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.33.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7c6680d9342c22c10d8272ebf9f0339b0e439b3e67b68f5627f9dfc6926a07" +checksum = "1eae0eac8034ba14437e772366336f579398a46d101de13dbb781ab1e35e67c5" dependencies = [ "hash-db", "log", "parity-scale-codec", "parking_lot", - "rand 0.8.5", + "rand", "smallvec", "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-trie", "thiserror", "tracing", @@ -4753,36 +4692,36 @@ dependencies = [ [[package]] name = "sp-std" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c78c5a66682568cc7b153603c5d01a2cc8f5c221c7b1e921517a0eef18ae05" +version = "14.0.0" [[package]] name = "sp-std" version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "17.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016f20812cc51bd479cc88d048c35d44cd3adde4accdb159d49d6050f2953595" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 12.0.0", - "sp-std 12.0.0", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sp-tracing" -version = "14.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d727cb5265641ffbb7d4e42c18b63e29f6cfdbd240aae3bcf093c3d6eb29a19" +checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" dependencies = [ "parity-scale-codec", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", "tracing-core", "tracing-subscriber", @@ -4790,23 +4729,23 @@ dependencies = [ [[package]] name = "sp-trie" -version = "27.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c4bf89a5bd74f696cd1f23d83bb6abe6bd0abad1f3c70d4b0d7ebec4098cfe" +checksum = "f1aa91ad26c62b93d73e65f9ce7ebd04459c4bad086599348846a81988d6faa4" dependencies = [ "ahash 0.8.7", "hash-db", - "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot", - "rand 0.8.5", + "rand", "scale-info", "schnellru", "sp-core", - "sp-std 12.0.0", + "sp-externalities", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "tracing", "trie-db", @@ -4815,45 +4754,45 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "18.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d85813d46a22484cdf5e5afddbbe85442dd1b4d84d67a8c7792f92f9f93607" +checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "wasmtime", ] [[package]] name = "sp-weights" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1689f9594c2c4d09ede3d8a991a9eb900654e424fb00b62f2b370170af347acd" +version = "27.0.0" dependencies = [ + "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 21.0.0", - "sp-core", - "sp-debug-derive 12.0.0", - "sp-std 12.0.0", + "sp-arithmetic 23.0.0", + "sp-debug-derive 14.0.0", ] [[package]] name = "sp-weights" -version = "27.0.0" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9af6c661fe3066b29f9e1d258000f402ff5cc2529a9191972d214e5871d0ba87" dependencies = [ - "bounded-collections 0.2.0", + "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 23.0.0", - "sp-debug-derive 14.0.0", + "sp-arithmetic 25.0.0", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4904,7 +4843,7 @@ name = "staging-xcm" version = "7.0.0" dependencies = [ "array-bytes", - "bounded-collections 0.2.0", + "bounded-collections", "derivative", "environmental", "impl-trait-for-tuples", @@ -4952,14 +4891,14 @@ dependencies = [ [[package]] name = "substrate-bip39" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e620c7098893ba667438b47169c00aacdd9e7c10e042250ce2b60b087ec97328" +checksum = "a2b564c293e6194e8b222e52436bcb99f60de72043c7f845cf6c4406db4df121" dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel 0.9.1", - "sha2 0.9.9", + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel", + "sha2 0.10.8", "zeroize", ] @@ -4971,8 +4910,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "subxt" -version = "0.33.0" -source = "git+https://github.com/paritytech/subxt.git?tag=v0.33.0#f06a95d687605bf826db9d83b2932a73a57b169f" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd68bef23f4de5e513ab4c29af69053e232b098f9c87ab552d7ea153b4a1fbc5" dependencies = [ "async-trait", "base58", @@ -4983,6 +4923,7 @@ dependencies = [ "futures", "hex", "impl-serde", + "instant", "jsonrpsee", "parity-scale-codec", "primitive-types", @@ -4994,19 +4935,22 @@ dependencies = [ "serde", "serde_json", "sp-core", - "sp-core-hashing", + "sp-crypto-hashing", "sp-runtime", "subxt-lightclient", "subxt-macro", "subxt-metadata", "thiserror", + "tokio-util", "tracing", + "url", ] [[package]] name = "subxt-codegen" -version = "0.33.0" -source = "git+https://github.com/paritytech/subxt.git?tag=v0.33.0#f06a95d687605bf826db9d83b2932a73a57b169f" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d9e2b256b71d31a2629e44eb9cbfd944eb7d577c9e0c8e9802cc3c3943af2d9" dependencies = [ "frame-metadata 16.0.0", "heck", @@ -5016,6 +4960,7 @@ dependencies = [ "proc-macro2", "quote", "scale-info", + "scale-typegen", "subxt-metadata", "syn 2.0.58", "thiserror", @@ -5024,8 +4969,9 @@ dependencies = [ [[package]] name = "subxt-lightclient" -version = "0.33.0" -source = "git+https://github.com/paritytech/subxt.git?tag=v0.33.0#f06a95d687605bf826db9d83b2932a73a57b169f" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f1ac12e3be7aafea4d037730a57da4f22f2e9c73955666081ffa2697c6f1" dependencies = [ "futures", "futures-util", @@ -5040,46 +4986,53 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.33.0" -source = "git+https://github.com/paritytech/subxt.git?tag=v0.33.0#f06a95d687605bf826db9d83b2932a73a57b169f" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98dc84d7e6a0abd7ed407cce0bf60d7d58004f699460cffb979640717d1ab506" dependencies = [ - "darling 0.20.5", + "darling 0.20.8", "parity-scale-codec", "proc-macro-error", + "quote", + "scale-typegen", "subxt-codegen", "syn 2.0.58", ] [[package]] name = "subxt-metadata" -version = "0.33.0" -source = "git+https://github.com/paritytech/subxt.git?tag=v0.33.0#f06a95d687605bf826db9d83b2932a73a57b169f" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc10c54028d079a9f1be65188707cd29e5ffd8d0031a2b1346a0941d57b7ab7e" dependencies = [ + "derive_more", "frame-metadata 16.0.0", + "hashbrown 0.14.3", "parity-scale-codec", "scale-info", - "sp-core-hashing", - "thiserror", + "sp-crypto-hashing", ] [[package]] name = "subxt-signer" -version = "0.33.0" -source = "git+https://github.com/paritytech/subxt.git?tag=v0.33.0#f06a95d687605bf826db9d83b2932a73a57b169f" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ccb59a38fe357fab55247756174435e8626b93929864e8a498635a15e779df8" dependencies = [ "bip39", + "cfg-if", + "derive_more", "hex", "hmac 0.12.1", "parity-scale-codec", "pbkdf2 0.12.2", "regex", - "schnorrkel 0.11.4", - "secp256k1 0.28.2", + "schnorrkel", + "secp256k1", "secrecy", "sha2 0.10.8", - "sp-core-hashing", + "sp-crypto-hashing", "subxt", - "thiserror", "zeroize", ] @@ -5151,7 +5104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", - "fastrand 2.0.1", + "fastrand", "rustix 0.38.31", "windows-sys 0.52.0", ] @@ -5167,18 +5120,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -5262,7 +5215,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -5284,7 +5237,18 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.10", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.3", + "rustls-pki-types", "tokio", ] @@ -5546,7 +5510,7 @@ dependencies = [ "http", "httparse", "log", - "rand 0.8.5", + "rand", "sha1", "thiserror", "url", @@ -5561,7 +5525,7 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand 0.8.5", + "rand", "static_assertions", ] @@ -5661,7 +5625,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.12", + "getrandom", "serde", ] @@ -5692,8 +5656,8 @@ dependencies = [ "arrayref", "constcat", "digest 0.10.7", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_core 0.6.4", "sha2 0.10.8", "sha3", @@ -5701,12 +5665,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "walkdir" version = "2.4.0" @@ -5726,12 +5684,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5966,7 +5918,7 @@ dependencies = [ "memfd", "memoffset", "paste", - "rand 0.8.5", + "rand", "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", diff --git a/smoketest/Cargo.toml b/smoketest/Cargo.toml index 8d45cab0b7..ab73a3c81e 100644 --- a/smoketest/Cargo.toml +++ b/smoketest/Cargo.toml @@ -11,12 +11,12 @@ tokio = { version = "1.35.0", features = ["macros", "rt-multi-thread", "time"] } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["bit-vec", "derive", "full"] } hex = "0.4.3" hex-literal = "0.4.1" -serde = { version = "1.0", features = ["derive"] } -subxt = { git = "https://github.com/paritytech/subxt.git", tag = "v0.33.0", features = ["substrate-compat"]} -subxt-macro = { git = "https://github.com/paritytech/subxt.git", tag = "v0.33.0" } -subxt-metadata = { git = "https://github.com/paritytech/subxt.git", tag = "v0.33.0" } -subxt-codegen = { git = "https://github.com/paritytech/subxt.git", tag = "v0.33.0" } -subxt-signer = { git = "https://github.com/paritytech/subxt.git", tag = "v0.33.0" } +serde = { version = "1.0.197", features = ["derive"] } +subxt = { version = "0.35.3", features = ["substrate-compat", "unstable-light-client"]} +subxt-macro = { version = "0.35.3" } +subxt-metadata = { version = "0.35.3" } +subxt-codegen = { version = "0.35.3" } +subxt-signer = { version = "0.35.3" } ethers = { git = "https://github.com/gakonst/ethers-rs", default-features = false, features = ["abigen", "ws"] } lazy_static = "1.4.0" diff --git a/smoketest/make-bindings.sh b/smoketest/make-bindings.sh index b6fb1cf0d4..791d9bdd0d 100755 --- a/smoketest/make-bindings.sh +++ b/smoketest/make-bindings.sh @@ -13,7 +13,7 @@ forge bind --module --overwrite \ # Install subxt command -v subxt || cargo install subxt-cli \ --git https://github.com/paritytech/subxt.git \ - --tag v0.33.0 + --tag v0.35.3 if ! lsof -Pi :11144 -sTCP:LISTEN -t >/dev/null; then echo "substrate nodes not running, please start with the e2e setup and rerun this script" diff --git a/smoketest/src/constants.rs b/smoketest/src/constants.rs index f72404a595..6948caee76 100644 --- a/smoketest/src/constants.rs +++ b/smoketest/src/constants.rs @@ -69,6 +69,10 @@ lazy_static! { .unwrap_or("2500000000000000".to_string()) .parse() .unwrap(); + pub static ref FEE_MULTIPLIER: u128 = env::var("FEE_MULTIPLIER") + .unwrap_or("1000000000000000000".to_string()) + .parse() + .unwrap(); pub static ref FEE_PER_GAS: u64 = env::var("FEE_PER_GAS").unwrap_or("20000000000".to_string()).parse().unwrap(); pub static ref LOCAL_REWARD: u128 = diff --git a/smoketest/tests/set_pricing_params.rs b/smoketest/tests/set_pricing_params.rs index 850590c96c..48192584c9 100644 --- a/smoketest/tests/set_pricing_params.rs +++ b/smoketest/tests/set_pricing_params.rs @@ -34,6 +34,7 @@ async fn set_pricing_params() { exchange_rate: FixedU128(*EXCHANGE_RATE), rewards: Rewards { local: *LOCAL_REWARD, remote: U256([*REMOTE_REWARD, 0, 0, 0]) }, fee_per_gas: U256([*FEE_PER_GAS, 0, 0, 0]), + multiplier: FixedU128(*FEE_MULTIPLIER), }) .encode_call_data(&test_clients.bridge_hub_client.metadata()) .expect("encoded call"); diff --git a/web/packages/test/.gitignore b/web/packages/test/.gitignore index 6d151bfe70..de90cea292 100644 --- a/web/packages/test/.gitignore +++ b/web/packages/test/.gitignore @@ -19,4 +19,5 @@ rococo-local.json .pnp.* ethereum-goerli testdata +beacon-state .env diff --git a/web/packages/test/scripts/deploy-contracts.sh b/web/packages/test/scripts/deploy-contracts.sh index 652720e1ed..e39b2b480e 100755 --- a/web/packages/test/scripts/deploy-contracts.sh +++ b/web/packages/test/scripts/deploy-contracts.sh @@ -5,7 +5,7 @@ source scripts/set-env.sh deploy_command() { local deploy_script=$1 - + pushd "$contract_dir" if [ "$eth_network" != "localhost" ]; then forge script \ @@ -27,7 +27,7 @@ deploy_command() { deploy_gateway_logic() { - deploy_command src/DeployGatewayLogic.sol:DeployGatewayLogic + deploy_command scripts/DeployGatewayLogic.sol:DeployGatewayLogic pushd "$test_helpers_dir" pnpm generateContracts "$output_dir/contracts.json" @@ -38,7 +38,7 @@ deploy_gateway_logic() deploy_contracts() { - deploy_command src/DeployScript.sol:DeployScript + deploy_command scripts/DeployScript.sol:DeployScript pushd "$test_helpers_dir" pnpm generateContracts "$output_dir/contracts.json" diff --git a/web/packages/test/scripts/fund-agent.sh b/web/packages/test/scripts/fund-agent.sh index 9187a4b586..e094e9c483 100755 --- a/web/packages/test/scripts/fund-agent.sh +++ b/web/packages/test/scripts/fund-agent.sh @@ -9,7 +9,7 @@ fund_agent() { --rpc-url $eth_endpoint_http \ --broadcast \ -vvv \ - src/FundAgent.sol:FundAgent + scripts/FundAgent.sol:FundAgent popd echo "Fund agent success!" diff --git a/web/packages/test/scripts/set-env.sh b/web/packages/test/scripts/set-env.sh index 24015ab9b2..631f5fbe1c 100755 --- a/web/packages/test/scripts/set-env.sh +++ b/web/packages/test/scripts/set-env.sh @@ -96,6 +96,7 @@ export REJECT_OUTBOUND_MESSAGES="${REJECT_OUTBOUND_MESSAGES:-false}" export REGISTER_TOKEN_FEE="${REGISTER_TOKEN_FEE:-200000000000000000}" export CREATE_ASSET_FEE="${CREATE_ASSET_FEE:-10000000000}" export RESERVE_TRANSFER_FEE="${RESERVE_TRANSFER_FEE:-10000000000}" +export RESERVE_TRANSFER_MAX_DESTINATION_FEE="${RESERVE_TRANSFER_MAX_DESTINATION_FEE:-10000000000000}" ## Pricing Parameters export EXCHANGE_RATE="${EXCHANGE_RATE:-2500000000000000}"