-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add value check #153
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
Conversation
Pull Request Test Coverage Report for Build 11505248479Details
💛 - Coveralls |
|
Having the cache in the indexer-service raises a small risk though. |
02dc7f2 to
e139644
Compare
b96d348 to
cd976d4
Compare
1577edc to
3559623
Compare
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.
This looks good to me @gusinacio , a lot of work in the making!
I think the tests could be made more defensive and clearer about intention, but I understand some of the limitations we're facing with testing and I trust this has been tested extensively observationally.
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.
Great work, @gusinacio! Lot's of great stuff in here. None of my requests are necessarily blocking, so I'm going to approve the PR. Your call whether to address them or not.
common/src/tap/checks/value_check.rs
Outdated
| } | ||
| } | ||
|
|
||
| fn get_expected_value(&self, agora_query: &AgoraQuery) -> anyhow::Result<u128> { |
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.
The naming can be somewhat arbitrary. For example, here, you have a getter get_expected_value, but in cost_model.rs, you have getters named cost_models and cost_model.
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.
Good with either, but just pick one.
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.
We have cost_models and cost_model there because they map to GraphQL queries that indexer-service has.
I usually use get_ but it's a Java mind hahaha, maybe a future refactor I should remove all getters into more meaningful names.
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.
I love that you thumbs-up'ed your own comment hahaha. Glad you agree with yourself 😂
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
Signed-off-by: Gustavo Inacio <[email protected]>
8442654 to
8092cab
Compare
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, @gusinacio!
This PR aims to create the value check for indexer-service. This means that our system checks if the gateway is sending the value that we are requesting, otherwise it rejects the query.
Initially, I was planning to do a cache system to allow queries that contain the older cost model but it exploded really fast in complexity.
Given conversations with indexers, they seemed to not care to lose a few queries during 30 seconds until the gateway fetches again the cost model.
In case this becomes a problem to indexers, we can implement it again.