Skip to content

Commit 971c08a

Browse files
kevpaq-520Darioush Jalaliqdm12
committed
update: readme changes for 9000 upgrade
See ava-labs/coreth#761 Co-authored-by: Darioush Jalali <[email protected]> Co-authored-by: Quentin McGaw <[email protected]>
1 parent 81c61aa commit 971c08a

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

precompile/contracts/warp/README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Integrating Avalanche Warp Messaging into the EVM
22

3-
Avalanche Warp Messaging offers a basic primitive to enable Cross-Subnet communication on the Avalanche Network.
3+
Avalanche Warp Messaging offers a basic primitive to enable Cross-L1 communication on the Avalanche Network.
44

55
It is intended to allow communication between arbitrary Custom Virtual Machines (including, but not limited to Subnet-EVM and Coreth).
66

77
## How does Avalanche Warp Messaging Work?
88

99
Avalanche Warp Messaging uses BLS Multi-Signatures with Public-Key Aggregation where every Avalanche validator registers a public key alongside its NodeID on the Avalanche P-Chain.
1010

11-
Every node tracking a Subnet has read access to the Avalanche P-Chain. This provides weighted sets of BLS Public Keys that correspond to the validator sets of each Subnet on the Avalanche Network. Avalanche Warp Messaging provides a basic primitive for signing and verifying messages between Subnets: the receiving network can verify whether an aggregation of signatures from a set of source Subnet validators represents a threshold of stake large enough for the receiving network to process the message.
11+
Every node tracking an Avalanche L1 has read access to the Avalanche P-Chain. This provides weighted sets of BLS Public Keys that correspond to the validator sets of each L1 on the Avalanche Network. Avalanche Warp Messaging provides a basic primitive for signing and verifying messages between L1s: the receiving network can verify whether an aggregation of signatures from a set of source L1 validators represents a threshold of stake large enough for the receiving network to process the message.
1212

1313
For more details on Avalanche Warp Messaging, see the AvalancheGo [Warp README](https://docs.avax.network/build/cross-chain/awm/deep-dive).
1414

@@ -77,27 +77,25 @@ Since the predicate is encoded into the [Transaction Access List](https://eips.e
7777

7878
Therefore, we use the [Predicate Utils](https://github.com/ava-labs/coreth/blob/master/predicate/Predicate.md) package to encode the actual byte slice of size N into the access list.
7979

80-
### Performance Optimization: C-Chain to Subnet
80+
### Performance Optimization: C-Chain to Avalanche L1
8181

82-
To support C-Chain to Subnet communication, or more generally Primary Network to Subnet communication, we special case the C-Chain for two reasons:
82+
For communication between the C-Chain and an L1, as well as broader interactions between the Primary Network and Avalanche L1s, we have implemented special handling for the C-Chain.
8383

84-
1. Every Subnet validator validates the C-Chain
85-
2. The Primary Network has the largest possible number of validators
84+
The Primary Network has a large validator set, which creates a unique challenge for Avalanche Warp messages. To reach the required stake threshold, numerous signatures would need to be collected and verifying messages from the Primary Network would be computationally costly. However, we have developed a more efficient solution.
8685

87-
Since the Primary Network has the largest possible number of validators for any Subnet on Avalanche, it would also be the most expensive Subnet to receive and verify Avalanche Warp Messages from as it reaching a threshold of stake on the primary network would require many signatures. Luckily, we can do something much smarter.
86+
When an Avalanche L1 receives a message from a blockchain on the Primary Network, we use the validator set of the receiving L1 instead of the entire network when validating the message. Note this is NOT possible if an L1 does not validate the Primary Network, in which case the Warp precompile must be configured with `requirePrimaryNetworkSigners`.
8887

89-
When a Subnet receives a message from a blockchain on the Primary Network, we use the validator set of the receiving Subnet instead of the entire network when validating the message. This means that the C-Chain sending a message can be the exact same as Subnet to Subnet communication.
88+
Sending messages from the C-Chain remains unchanged.
89+
However, when L1 XYZ receives a message from the C-Chain, it changes the semantics to the following:
9090

91-
However, when Subnet B receives a message from the C-Chain, it changes the semantics to the following:
91+
1. Read the `SourceChainID` of the signed message (C-Chain)
92+
2. Look up the `SubnetID` that validates C-Chain: Primary Network
93+
3. Look up the validator set of L1 XYZ (instead of the Primary Network) and the registered BLS Public Keys of L1 XYZ at the P-Chain height specified by the ProposerVM header
94+
4. Continue Warp Message verification using the validator set of L1 XYZ instead of the Primary Network
9295

93-
1. Read the SourceChainID of the signed message (C-Chain)
94-
2. Look up the SubnetID that validates C-Chain: Primary Network
95-
3. Look up the validator set of Subnet B (instead of the Primary Network) and the registered BLS Public Keys of Subnet B at the P-Chain height specified by the ProposerVM header
96-
4. Continue Warp Message verification using the validator set of Subnet B instead of the Primary Network
96+
This means that C-Chain to L1 communication only requires a threshold of stake on the receiving L1 to sign the message instead of a threshold of stake for the entire Primary Network.
9797

98-
This means that C-Chain to Subnet communication only requires a threshold of stake on the receiving subnet to sign the message instead of a threshold of stake for the entire Primary Network.
99-
100-
This assumes that the security of Subnet B already depends on the validators of Subnet B to behave virtuously. Therefore, requiring a threshold of stake from the receiving Subnet's validator set instead of the whole Primary Network does not meaningfully change security of the receiving Subnet.
98+
This assumes that the security of L1 XYZ already depends on the validators of L1 XYZ to behave virtuously. Therefore, requiring a threshold of stake from the receiving L1's validator set instead of the whole Primary Network does not meaningfully change security of the receiving L1.
10199

102100
Note: this special case is ONLY applied during Warp Message verification. The message sent by the Primary Network will still contain the Avalanche C-Chain's blockchainID as the sourceChainID and signatures will be served by querying the C-Chain directly.
103101

@@ -107,7 +105,7 @@ Note: this special case is ONLY applied during Warp Message verification. The me
107105

108106
Avalanche Warp Messaging depends on the Avalanche P-Chain state at the P-Chain height specified by the ProposerVM block header.
109107

110-
Verifying a message requires looking up the validator set of the source subnet on the P-Chain. To support this, Avalanche Warp Messaging uses the ProposerVM header, which includes the P-Chain height it was issued at as the canonical point to lookup the source subnet's validator set.
108+
Verifying a message requires looking up the validator set of the source L1 on the P-Chain. To support this, Avalanche Warp Messaging uses the ProposerVM header, which includes the P-Chain height it was issued at as the canonical point to lookup the source L1's validator set.
111109

112110
This means verifying the Warp Message and therefore the state transition on a block depends on state that is external to the blockchain itself: the P-Chain.
113111

0 commit comments

Comments
 (0)