-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: change subgraph constructor to use full urls #2381
feat: change subgraph constructor to use full urls #2381
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
Looks good so far. It's just that we have to pass in 1 additional argument because we need to use 2 different URLs for balancer and uniswap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crates/driver/src/infra/config/file/mod.rs also needs to get the url on both the BalancerV2
as well as the Uniswapv3
struct. Can we also make sure the existing integration tests (not part of CI) are still working?
Thanks for the the directions @fleupold
FYI: this is my first time doing some rust after reading the Rust Book so I much appreciate the patience on providing some directions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also thanks for being patient with our feedback. We know that all the config code is not the easiest to maneuver. :)
Only thing left is to move the config arguments to the right location for the driver
.
In the end you should be able to configure something like:
[[liquidity.balancer-v2]]
vault = "0x..."
# ...other balancer args
graph-url = "https://..."
instead of:
[liquidity]
balancer-graph-url = "https://..."
[[liquidity.balancer-v2]]
# args without graph-url
Co-authored-by: Martin Beckmann <martin.beckmann@protonmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fredmarques, this PR looks pretty good already, only missing thing seems to be to move uniswap_v3_graph_url
into the UniswapV3Config
struct (and balancer_v2_graph_url
into BalancerV2Config
).
Are you still planning to do this change?
Oh yes! I was fixing some tests and something else required my attention. Let me finalize it. |
I'm facing this issue: error[E0658]: use of unstable library feature 'arc_unwrap_or_clone'
--> crates/shared/src/price_estimation/trade_finder.rs:58:15
|
58 | ..Arc::unwrap_or_clone(self.inner)
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #93610 <https://github.com/rust-lang/rust/issues/93610> for more information
For more information about this error, try `rustc --explain E0658`. Are we using nightly rust? |
|
that must be it. I'm on 1.75. |
I'm trying to run test-forked-node with FORK_URL_MAINNET="https://eth.merkle.io" FORK_URL_GNOSIS="https://rpc.gnosischain.com/" cargo nextest run -p e2e forked_node --nocapture --run-ignored ignored-only I'm getting this error:
I assume my FORK_URL_GNOSIS is wrong. |
We should have this documented. If not, with public URLs (I don't know why it's a secret on Git Hub Actions), at least the step-by-step procedure on how to obtain such URLs. |
For forked tests you need an archive node. If you don't have access to one (I don't know of a free version for Gnosis Chain), don't worry we can let the CI run those tests (they are unlikely to fail due to this code change) |
Great! Now I only see outdated conversationi so can we run the CI one more time? I got all green tests on my local. |
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
@fleupold could you do another review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here. Will re-run the tests. Unfortunately I noticed a configuration issue that I'm not happy with (somewhat silently failing with default values on other chains).
I'm not sure if you still have energy to work through that. Otherwise I'll try to amend this PR sometime this week.
crates/shared/src/arguments.rs
Outdated
#[clap( | ||
long, | ||
env, | ||
default_value = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not great that this default now only works for mainnet.
I wonder if it would be better to make this value Option and implement the default based on the current connected chain similar to how we have it currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the graph is shutting down for good there is no public URL that we could be using for these defaults.
Will make all values optional and only enable the liquidity source if the URLs have been set. Also there are a bunch of old and ignored tests that need the public URLs. I will delete them since they will no longer be functional.
Hi, since the graph apparently actually shut down the old hosted graphs for good we need this PR merged now ASAP to be able to index balancer and uniswap v3 liquidity again. |
changes addressed and this hotfix is urgent
Description
This PR fixes #2105
Changes
Subgraph constrictor now uses full urls
How to test
All unit tests still pass
Related Issues
Fixes #2105