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

Allow cost models in single network mode #899

Merged
merged 4 commits into from
Jun 25, 2024
Merged

Allow cost models in single network mode #899

merged 4 commits into from
Jun 25, 2024

Conversation

aasseman
Copy link
Contributor

  • multiNetworks was erroneously typed as possibly undefined, and undefined was used as a way to determine if we are in multi or single network mode in cost-models.ts.
    However, the code doesn't actually allow for multiNetworks to be undefined, be it in multi or single network mode.
  • The inject DAI setting now defaults to false
  • Cost models are allowed only if in single network mode and:
    • On Ethereum mainnet
    • On any other network and "inject DAI" off

Some of these changes should be inconsequential considering the impending deprecation of Ethereum mainnet, as well as the fact that most indexers stopped using cost models due in part to #789.

Fixes #789

`multiNetworks` was erroneously typed as possibly `undefined`, and `undefined` was used as a way to determine if we are in multi or single network mode in `cost-models.ts`.
However, the code doesn't actually allow for `multiNetworks` to be undefined, be it in multi or single network mode.

Signed-off-by: Alexis Asseman <alexis@semiotic.ai>
…settings

Signed-off-by: Alexis Asseman <alexis@semiotic.ai>
@aasseman aasseman requested a review from fordN May 24, 2024 23:06
@aasseman aasseman changed the title Aasseman/issue789 Allow cost models when acceptable May 24, 2024
@aasseman
Copy link
Contributor Author

Oops should have run prepare on indexer-service too

Check for undefined and fail in cost models. Since `setCostModel` is only run by indexer-agent, and indexer-agent must have a network defined.

Signed-off-by: Alexis Asseman <alexis@semiotic.ai>
@aasseman aasseman removed the request for review from fordN May 24, 2024 23:43
@aasseman aasseman marked this pull request as draft May 24, 2024 23:43
Signed-off-by: Alexis Asseman <alexis@semiotic.ai>
@aasseman aasseman changed the title Allow cost models when acceptable Allow cost models in single network mode May 25, 2024
@aasseman aasseman marked this pull request as ready for review May 25, 2024 01:45
@aasseman aasseman requested review from fordN and dwerner May 25, 2024 01:45
@fordN fordN added the bug Something isn't working label Jun 24, 2024
Copy link
Contributor

@dwerner dwerner left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. I had a read through and it all looks good to me.

@aasseman aasseman merged commit 2c6960f into main Jun 25, 2024
10 checks passed
@aasseman aasseman deleted the aasseman/issue789 branch June 25, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🚗 Merged
Development

Successfully merging this pull request may close these issues.

Unable to define cost model after upgrading to v0.20.22 indexer SW on arbitrum-one
3 participants