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

[CIP-20] Batch Reward Query #199

Merged
merged 6 commits into from
Feb 28, 2023
Merged

[CIP-20] Batch Reward Query #199

merged 6 commits into from
Feb 28, 2023

Conversation

bh2smith
Copy link
Contributor

This query extracts solver reward info from the DB in order to compute the weekly solver rewards. Top half of this query (up till rewards_per_tx) has already been reviewed in the dune-sync project. Now we aggregate this for the primary and secondary totals for the period.

Comment on lines +3 to +11
tx_hash,
solver,
s.block_number,
-- settlement_observations
effective_gas_price * gas_used AS execution_cost,
surplus,
fee,
-- auction_transaction
at.auction_id
Copy link
Contributor

@gentrexha gentrexha Feb 28, 2023

Choose a reason for hiding this comment

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

Nit: I think adding the table from where each column is coming would make the query more understandable.

tx_hash -> s.tx_hash

Copy link
Collaborator

@fhenneke fhenneke left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Contributor

@gentrexha gentrexha left a comment

Choose a reason for hiding this comment

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

Is there a way for me to test these subparts of queries and look at the results?

I find this very hard to review in detail without doing that. Otherwise, I'm just skimming the code.

@bh2smith
Copy link
Contributor Author

Is there a way for me to test these subparts of queries and look at the results?

The unit tests for this query are introduced in the follow up PR based on this. I could actually merge that into here if you'd like to see them together cf #200.

@gentrexha
Copy link
Contributor

The unit tests for this query are introduced in the follow up PR based on this. I could actually merge that into here if you'd like to see them together cf #200.

I just reviewed that, and it's a lot easier to make sense there. Don't see the need to merge them now but in the future, I think it would make sense to see those together.

@bh2smith
Copy link
Contributor Author

This can be merged because it does not affect the primary code path.

@bh2smith bh2smith merged commit 8e1ebcd into main Feb 28, 2023
@bh2smith bh2smith deleted the extract_batch_rewards branch February 28, 2023 15:05
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants