From 8a70e708b0da001944e8c7d4adc7673d5c85ae7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Parrino?= Date: Fri, 26 Jul 2024 15:08:15 -0300 Subject: [PATCH] Update multichain-server article (#2172) * Update multichain-server.md * Update overview.md --- .../multichain-gas-relayer/gas-station.md | 23 +++++++++++------ .../multichain-server.md | 25 ++++++++++++------- .../multichain-gas-relayer/overview.md | 4 +-- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/docs/2.build/1.chain-abstraction/multichain-gas-relayer/gas-station.md b/docs/2.build/1.chain-abstraction/multichain-gas-relayer/gas-station.md index 0b15d1b863b..b8d1d1255d5 100644 --- a/docs/2.build/1.chain-abstraction/multichain-gas-relayer/gas-station.md +++ b/docs/2.build/1.chain-abstraction/multichain-gas-relayer/gas-station.md @@ -6,12 +6,6 @@ sidebar_label: Multichain Gas Station Contract The [multichain gas station smart contract](https://github.com/near/multichain-gas-station-contract) accepts payments in NEAR tokens in exchange for gas funding on non-NEAR foreign chains. Part of the NEAR Multichain effort, it works in conjunction with the [MPC recovery service](https://github.com/near/mpc-recovery) to generate on-chain signatures. -:::info Alpha stage - -The Multichain Relayer solution is currently under development. Users who want to test-drive this solution should keep in mind that the product is in alpha stage, and a code audit is pending. - -::: - ## What is it? This smart contract is a piece of the NEAR Multichain project, which makes NEAR Protocol an effortlessly cross-chain network. This contract accepts EVM transaction request payloads and facilitates the signing, gas funding, and relaying of the signed transactions to their destination chains. It works in conjunction with a few different services, including: @@ -97,6 +91,17 @@ You can review the complete smart contract source code in [this GitHub repositor - Pyth oracle price fee IDs can be [found here](https://pyth.network/developers/price-feed-ids) 4. Add paymasters to each foreign chain with `add_paymaster`. +### Price Pusher + +In order to get up-to-date information on gas prices for foreign chains, a price pusher service must be run, either on demand or as a `cron` job. + +Suggested tools: +- [Pyth Price Pusher](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/price_pusher): this price pusher supports `BNB` and `ETH` + +:::tip +A separate price pusher should be used for each token. +::: + ### Usage Users who wish to get transactions signed and relayed by this contract and its accompanying infrastructure should perform the following steps: @@ -110,9 +115,11 @@ Users who wish to get transactions signed and relayed by this contract and its a - Repeat `pending_transactions_count` times. 4. Relay each signed payload to the foreign chain RPC in the order they were requested. -:::tip testnet contract +:::tip Contract address -If you want to try things out, this smart contract is available on `canhazgas.testnet`. +If you want to try things out, this smart contract is available on: +- testnet: `canhazgas.testnet` +- mainnet: `TBD` ::: diff --git a/docs/2.build/1.chain-abstraction/multichain-gas-relayer/multichain-server.md b/docs/2.build/1.chain-abstraction/multichain-gas-relayer/multichain-server.md index 6eeed4e3b0e..e0c018b7529 100644 --- a/docs/2.build/1.chain-abstraction/multichain-gas-relayer/multichain-server.md +++ b/docs/2.build/1.chain-abstraction/multichain-gas-relayer/multichain-server.md @@ -6,12 +6,6 @@ sidebar_label: Multichain Relayer Server The [Multichain Relayer Server](https://github.com/near/multichain-relayer-server) facilitates cross-chain transactions and enables Chain Abstraction. -:::info Alpha stage - -The Multichain Relayer solution is currently under development. Users who want to test-drive this solution should keep in mind that the product is in alpha stage, and a code audit is pending. - -::: - ## Overview The main function of this server is interfacing with foreign chain RPCs sending both presigned funding transactions to cover gas and the actual presigned transaction once the funding is done. @@ -19,7 +13,7 @@ The main function of this server is interfacing with foreign chain RPCs sending Although the multichain relayer is a server in current design of this system, the goal is to package this as a library that can be called on the client side of the wallet. This will make the system more decentralized. :::tip -The Multichain Relayer is meant to be deployed alongside the [Gas Station Event Indexer](https://github.com/near/gas-station-event-indexer) on the same server so that the gas station event indexer can call the multichain relayer server via IPC instead of having to send the request over the network introducing extra latency to the system. +The Multichain Relayer is meant to be deployed alongside the [Gas Station Event Indexer](https://github.com/near/gas-station-event-indexer) on the same server so that the Gas Station event indexer can call the Multichain Relayer server via IPC instead of having to send the request over the network introducing extra latency to the system. ::: ## Paymaster @@ -68,8 +62,21 @@ For independent deployments of gas station contracts, generally, nonce synchroni ## Supported Chains -- BSC testnet -- BSC mainnet, Ethereum mainnet, and more chains coming soon! +#### Testnet + +- Arbitrum (Ethereum Sepolia) +- Base (Ethereum Sepolia) +- BSC +- Ethereum (Sepolia) +- Optimism (Ethereum Sepolia) + +#### Mainnet + +- Arbitrum (Ethereum L2) +- Base (Ethereum L2) +- BSC +- Ethereum +- Optimism (Ethereum L2) :::info Check the Relayer's [GitHub repository](https://github.com/near/multichain-relayer-server) to learn more about upcoming features and updates. diff --git a/docs/2.build/1.chain-abstraction/multichain-gas-relayer/overview.md b/docs/2.build/1.chain-abstraction/multichain-gas-relayer/overview.md index 39acdfff45a..199324ba8a6 100644 --- a/docs/2.build/1.chain-abstraction/multichain-gas-relayer/overview.md +++ b/docs/2.build/1.chain-abstraction/multichain-gas-relayer/overview.md @@ -40,7 +40,7 @@ Below is a design diagram of the entire Multichain Relayer system: - The [gas station contract](gas-station.md) and the [MPC signing service contract](https://github.com/near/mpc-recovery/tree/main/contract) are in the green box which take place on NEAR. - The [multichain relayer server](multichain-server.md) focuses on the blue _Multichain Relayer Core Backend Services_ box in the middle and the connections to the XChain systems in the red box via RPCs. -- The [XChain Settlement](gas-station.md#settlement) process happening in the yellow box can be either manual or automated. Automated settlement is available for select partners based on their xChain transaction volume. +- The [XChain Settlement](gas-station.md#settlement) process happening in the yellow box can be either manual or automated. [Automated settlement](gas-station.md#automated-settlement) is available for select partners based on their xChain transaction volume. ::: @@ -60,7 +60,7 @@ Below is a design diagram of the entire Multichain Relayer system: - **Paymaster Accounts**: These are accounts on the destination chains that hold the native gas tokens. They ensure users have enough gas to complete their transactions on foreign chains. - **xChain Settlement**: regular [cross-chain settlement](gas-station.md#settlement) is needed to ensure paymaster accounts have sufficient funds. This can be manual or automated, and involves swapping NEAR tokens for foreign chain tokens and transferring them to the paymaster accounts. - - Automated settlement is available for select partners based on their cross-chain transaction volume. + - [Automated settlement](gas-station.md#automated-settlement) is available for select partners based on their cross-chain transaction volume. - **Supported Chains**: Initially supports BSC, Ethereum, Base, Arbitrum, and Optimism with plans to expand to other chains. ## Limitations and Considerations