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

Add FeePricer to quoter #1684

Merged
merged 29 commits into from
Dec 21, 2023
Merged

Conversation

dwasse
Copy link
Collaborator

@dwasse dwasse commented Dec 20, 2023

Adds FeePricer for setting the FixedFee value in the quoter.

@dwasse dwasse marked this pull request as draft December 20, 2023 17:44
Copy link
Contributor

coderabbitai bot commented Dec 20, 2023

Important

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@github-actions github-actions bot added go Pull requests that update Go code size/s labels Dec 20, 2023
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (fix/new-rfq-api-changes@90d47cc). Click here to learn what that means.

Additional details and impacted files
@@                      Coverage Diff                      @@
##             fix/new-rfq-api-changes       #1684   +/-   ##
=============================================================
  Coverage                           ?   50.71044%           
=============================================================
  Files                              ?         402           
  Lines                              ?       27659           
  Branches                           ?         284           
=============================================================
  Hits                               ?       14026           
  Misses                             ?       12242           
  Partials                           ?        1391           
Flag Coverage Δ
cctp-relayer 63.00863% <0.00000%> (?)
ethergo 60.53462% <0.00000%> (?)
explorer 25.43225% <0.00000%> (?)
git-changes-action 53.94265% <0.00000%> (?)
omnirpc 53.23194% <0.00000%> (?)
promexporter 73.80952% <0.00000%> (?)
release-copier-action 19.33333% <0.00000%> (?)
rfq 36.30278% <0.00000%> (?)
scribe 52.21130% <0.00000%> (?)
sinner 64.60481% <0.00000%> (?)
terraform-provider-helmproxy 16.98113% <0.00000%> (?)
terraform-provider-iap 18.68687% <0.00000%> (?)
terraform-provider-kubeproxy 22.83737% <0.00000%> (?)
tfcore 29.83607% <0.00000%> (?)
tools 21.98661% <0.00000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dwasse dwasse force-pushed the fix/new-rfq-fixed-fee-logic branch from ff9a775 to c734165 Compare December 20, 2023 18:09
@github-actions github-actions bot added size/m and removed size/s labels Dec 20, 2023
@dwasse dwasse force-pushed the fix/new-rfq-fixed-fee-logic branch from cf15427 to 9e3aa5a Compare December 20, 2023 21:52
@dwasse dwasse force-pushed the fix/new-rfq-fixed-fee-logic branch from 9887ec4 to 23d2838 Compare December 20, 2023 23:32
@dwasse dwasse marked this pull request as ready for review December 20, 2023 23:33
@trajan0x
Copy link
Contributor

trajan0x commented Dec 21, 2023

Debugging Log

Will be documenting debugging process here (quid posteos & because I'm too tired to do it in my head)

Gas Token, Maybe?

Managed to identify the issue behind the failing e2e tests. feePricer is failing to recognize the token

image

Seems like, for whatever reason, tokenAddr in config is empty:

image

This only appears to be the case for gas tokens (e.g. ETH and MATIC):

image

Moar Info

Needed some more info so setup 212daa0 to try to get some exact details on the token who's name can't be found. Doesn't seem to be a gas token since addr is not "=="

From this, we can get the name is Dai Stablecoin:

image

Okay, now we're getting somewhere. This token is in QuotableTokens, but never gets added to ChainConfig.Tokens, which is odd considering I thought we took care of this here:

image

Seems root of the problem is here:

image

Where only USDC is added

As expected, adding USDC fixes the test:

image

Should be fixed as of: 59a5c47

@@ -194,10 +196,24 @@ func (i *IntegrationSuite) setupRelayer() {
originBackendChainID: {
Bridge: i.manager.Get(i.GetTestContext(), i.originBackend, testutil.FastBridgeType).Address().String(),
Confirmations: 0,
Tokens: map[string]relconfig.TokenConfig{
"ETH": relconfig.TokenConfig{
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure we actually need gas token symbol here, but ok.

Think the reality is, before e deploy (or slightly after) config is going to need a complete overhaul in #1650, just don't think this pr is the appropriate place to do that.

My recommendations or how to go about this is:

  1. Convert all current references to pieces of the Config struct to Getters similiar to Submitter IConfig
  2. Reference those
  3. Rewrite the configs
  4. Fix the e2e tests

Copy link
Contributor

@trajan0x trajan0x left a comment

Choose a reason for hiding this comment

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

LGTM

@trajan0x trajan0x merged commit 2d03e70 into fix/new-rfq-api-changes Dec 21, 2023
55 of 58 checks passed
@trajan0x trajan0x deleted the fix/new-rfq-fixed-fee-logic branch December 21, 2023 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants