Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit c9380a4

Browse files
DylanTinianovdhaidashenkojmank88
authored andcommitted
Chain Agnostic MultiNode + EVM Implementation (#13386)
* Update rpc client * Update RPCClient * Update RPCClient * use Eth Subscription for heads * Make RpcClient public * Update node * Update Multinode * Fix build + generate * Udate multinode * update multinode * fix tests * Fix mocks * Update node_lifecycle_test.go * Fix all client tests * Fix tests * Update client_test.go * go mod tidy * fix tests * Fix tests * Clean up * Fix features test mocking * Fix logging * Remove logging * Fix tests * Fix context * lint * Update node_lifecycle_test.go * Remove unused generics * Add state locking * Set block difficulty * Update node_lifecycle.go * Fix tests * Make NodeStates public * Update multi_node_test.go * Update Unsubscribe * Remove HEAD generic from Node interface * Remove unneeded generics * Remove unneeded generics from Multinode * Remove Multinode as interface * Add PoolChainInfoProvider * Setup SendOnly nodes * Test empty context * Add err to log * Add rpc newHeads method * Fix context * Changeset * Remove unused mocks * Create Transaction Sender * Implement TransactionSender * Fix transaction sender types * Implement transaction sender tests * Ensure MultiNode is running * Address comments * Remove ChainClientRPC interface * Remove unneeded test * Generate mocks * Fix tests * fix tests * Use UnsubscribeAllExcept * Fix rpc client tests * Address comments * Remove unused code * Generate private mock * lint * Fix locks and unsubscribing * Update node.go * fixed flaky headtracker tests * Update node_lifecycle_test.go * Update node_lifecycle_test.go * Update transaction sender * Update chain_client_test.go * Remove unused variables * lint * enable secondary url test * Use http if not nil * Update transaction_sender.go * Add close method * Update rpc_client.go * changeset * Add Close to transaction sender * Return struct not interface * Remove flaky test * Fix context * Test if mn closes * Fix context cancel * Fix DoAll * lint generate * Revert * Fix mocks * Update node_lifecycle.go * lint * Delete rpc_client.go * Address comments * Fix tests * Update common/client/send_only_node.go Co-authored-by: Dmytro Haidashenko <[email protected]> * Address comments * Address comments * Rename SubscribeToHeads * Return code * Update transaction_sender.go * Fix merge conflicts * Handle batch requests * Delete mock_rpc_client_test.go * Update common/client/types.go Co-authored-by: Dmytro Haidashenko <[email protected]> * Move RPC methods * Use map for subs * Don't cancel context * Update transaction_sender.go * Fix lint * Delete late-mails-battle.md * lint * lint * Check Transaction Sender state * Return Retryable * Update core/chains/evm/client/chain_client_test.go Co-authored-by: Jordan Krage <[email protected]> * Update sub_forwarder.go * Update config.go * lint * Don't export nodeState * Update changeset * Use subsSliceMu * lint * Update rpc_client.go * nil ws url for sendonly nodes * Use head polling --------- Co-authored-by: Dmytro Haidashenko <[email protected]> Co-authored-by: Dmytro Haidashenko <[email protected]> Co-authored-by: Jordan Krage <[email protected]>
1 parent aa0f5ce commit c9380a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2594
-2481
lines changed

.changeset/orange-feet-share.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
"chainlink": minor
3+
---
4+
5+
Implemented new chain agnostic MultiNode design along with the corresponding EVM implementation. The chain agnostic components enable Multinode to be integrated with Solana and other non-EVM chains. Previously the Multinode was coupled with EVM specific actions, and was called to execute these actions direclty. With this change, the MultiNode's responsibility has been simplified to focus on RPC selection along with performing health checks. Chain specific actions will instead be executed on the RPC directly after being selected by MultiNode. The Chain Agnostic MultiNode provides improved reliability and metrics for all chain integrations using it.
6+
7+
These are following main components:
8+
Node: Common component which wraps an RPC with state information, health checks, and an alive loop to handle state changes along with maintaining chain information.
9+
RPCClient: Chain-specific RPC wrapper which implements required interface for MultiNode along with any chain-specific functionality needed.
10+
MultiNode: Perform RPCClient selection and performs health checks on all RPCs.
11+
TransactionSender: Chain agnostic component which broadcasts transactions to all healthy RPCs and aggregates results. A chain-specific error classifier must be implemented.
12+
13+
MultiNode picks the "best" RPC based on one of the configurable criteria:
14+
- Priority defined in the config.
15+
- Highest latest block.
16+
- Round-robin within the same priority level (or using other configurable selection algorithms)
17+
18+
Benefits of Chain Agnostic MultiNode:
19+
Reliability: Improved RPC reliability scaleable to all chains
20+
Maintainability: Can apply changes across all chain integrations through the use of common code
21+
Extendability: Can add new health checks, RPC selection and ranking algorithms
22+
Integration Speed: Much faster to integrate MultiNode with new chains
23+
Reduced Generics: Significantly less bulky code!
24+
25+
#updated #changed #internal

.mockery.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ packages:
1414
NodeSelector:
1515
sendOnlyClient:
1616
SendOnlyNode:
17-
RPC:
17+
RPCClient:
1818
Head:
19-
NodeClient:
2019
PoolChainInfoProvider:
2120
github.com/smartcontractkit/chainlink/v2/common/headtracker:
2221
interfaces:
@@ -50,7 +49,6 @@ packages:
5049
github.com/smartcontractkit/chainlink/v2/core/chains/evm/client:
5150
interfaces:
5251
Client:
53-
RPCClient:
5452
github.com/smartcontractkit/chainlink/v2/core/chains/evm/config:
5553
interfaces:
5654
GasEstimator:

common/client/mock_node_selector_test.go

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)