Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-Chain compatibility #115

Merged
merged 16 commits into from
Dec 21, 2023
Merged

C-Chain compatibility #115

merged 16 commits into from
Dec 21, 2023

Conversation

cam-schultz
Copy link
Collaborator

@cam-schultz cam-schultz commented Dec 18, 2023

Why this should be merged

With Avalanchego v1.10.17, Warp is enabled by default on the C-Chain for local networks, opening a path to easily test Teleporter and AWM Relayer. This PR adds E2E test cases to test relaying between the C-Chain and a subnet, as well as modifications to the relayer signature aggregation logic.

Fixes #113
Fixes #117

How this works

  • Extends the Basic Relay E2E test case to use the C-Chain/Primary Network as one of the subnets, and relay a message in each direction between the C-Chain and a subnet
  • Modifies the internal signature aggregation logic to use the Warp client included in subnet-evm and coreth, rather than the custom AppRequest logic. There are further changes needed to get the AppRequest approach working with the C-Chain, meanwhile the Warp client works out-of-the-box (issue here: Support AppRequests for the C-Chain #117)
  • EDIT: AppRequests to the C-Chain are working in this PR. I'll leave in the logic to use the Warp API in place, and track adding a config option to support that here: Add config option to use Warp API to gather signatures #119

How this was tested

Extended E2E tests.

How is this documented

N/A

@cam-schultz cam-schultz changed the title C chain integ tests C-Chain compatibility Dec 19, 2023
@cam-schultz cam-schultz self-assigned this Dec 19, 2023
@cam-schultz cam-schultz marked this pull request as ready for review December 19, 2023 02:22
Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

utils/utils.go Show resolved Hide resolved
utils/utils.go Show resolved Hide resolved
relayer/message_relayer.go Show resolved Hide resolved
relayer/message_relayer.go Outdated Show resolved Hide resolved
relayer/message_relayer.go Show resolved Hide resolved
relayer/message_relayer.go Outdated Show resolved Hide resolved
return nil, err
}
return warpMsg, err
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think we need this else

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Removed.

@@ -311,7 +411,7 @@ func (r *messageRelayer) createSignedMessage(requestID uint32) (*warp.Message, e
}

// As soon as the signatures exceed the stake weight threshold we try to aggregate and send the transaction.
if utils.CheckStakeWeightExceedsThreshold(accumulatedSignatureWeight, totalValidatorWeight, utils.DefaultQuorumNumerator, utils.DefaultQuorumDenominator) {
if utils.CheckStakeWeightExceedsThreshold(accumulatedSignatureWeight, totalValidatorWeight, params.WarpDefaultQuorumNumerator, params.WarpQuorumDenominator) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we by default be using the coreth.params? What if subnet-evm has different values, and the message we're sending doesn't interact with the primary network

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should make that distinction. I added a comment to #8 to fetch the numerator config from the VM, rather than using a hardcoded value.

geoff-vball
geoff-vball previously approved these changes Dec 20, 2023
@cam-schultz cam-schultz merged commit 76056e3 into main Dec 21, 2023
7 checks passed
@cam-schultz cam-schultz deleted the c-chain-integ-tests branch December 21, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Support AppRequests for the C-Chain Implement C-Chain <> subnet integration test
4 participants