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

Warp API support #345

Merged
merged 15 commits into from
Jun 26, 2024
Merged

Warp API support #345

merged 15 commits into from
Jun 26, 2024

Conversation

cam-schultz
Copy link
Collaborator

@cam-schultz cam-schultz commented Jun 25, 2024

Why this should be merged

Fixe #119. Exposes config options to fetch Warp message aggregate signatures via the Warp API rather than app request.

How this works

Adds SourceBlockchain.WarpAPIEndpoint config option. Internally, ApplicationRelayers are composed of [rpc.Client](https://github.com/ava-labs/subnet-evm/blob/master/rpc/client.go) rather than [warp.Client](https://github.com/ava-labs/subnet-evm/blob/master/warp/client.go). This is because warp.Client does not presently support query params or http headers, and expects the URI to be in a specific form.

How this was tested

Added Warp API e2e test.

How is this documented

Updated README

Copy link
Collaborator

@michaelkaplan13 michaelkaplan13 left a comment

Choose a reason for hiding this comment

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

Two small nits, but LGTM. Thanks for putting this together so quickly.

Totally fine with punting on the question in the E2E regarding checking that the API is actually used for now; worth thinking about though IMO

)
// Enable the Warp API for all source blockchains
for _, subnet := range relayerConfig.SourceBlockchains {
subnet.WarpAPIEndpoint = subnet.RPCEndpoint
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any (easy) way to check that the API endpoint is actually used by this test? Not necessary right now, but if the configuration changed in the future this test may silently pass if it falls back to using the P2P requests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm that's a good question that I don't immediately know the best answer to. We could add distinct metrics and monitor those from the test. Those metrics would be useful in a deployment as well. I'll look into this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added those metrics in and now check them in the test.

relayer/application_relayer.go Outdated Show resolved Hide resolved
relayer/application_relayer.go Outdated Show resolved Hide resolved
geoff-vball
geoff-vball previously approved these changes Jun 26, 2024
tests/warp_api.go Outdated Show resolved Hide resolved
networkLogLevel := logging.Error
if logLevel <= logging.Debug {
networkLogLevel = logLevel
}
network, err := peers.NewNetwork(
networkLogLevel,
registerer,
prometheus.DefaultRegisterer,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

While adding in the new get signature metrics, I noticed that we also collect a TON of unrelated network and app requests metrics. This disables these extra metrics from being collected.

cam-schultz and others added 3 commits June 26, 2024 10:08
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com>
Signed-off-by: cam-schultz <78878559+cam-schultz@users.noreply.github.com>
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com>
Signed-off-by: cam-schultz <78878559+cam-schultz@users.noreply.github.com>
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com>
Signed-off-by: cam-schultz <78878559+cam-schultz@users.noreply.github.com>
Copy link
Collaborator

@michaelkaplan13 michaelkaplan13 left a comment

Choose a reason for hiding this comment

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

🙏

@cam-schultz cam-schultz merged commit 5cbcdb0 into main Jun 26, 2024
7 checks passed
@cam-schultz cam-schultz deleted the warp-api-support branch June 26, 2024 15:25
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.

3 participants