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

read rebase logs from database instead of from the chain #256

Merged
merged 2 commits into from
Dec 1, 2022

Conversation

sparrowDom
Copy link
Member

@sparrowDom sparrowDom commented Dec 1, 2022

  • fetches rebase logs form the database instead of the chain
  • does half as many rebase log requests

issue: #254

# get rebase log at block number
def get_rebase_log(block_number):
rebase_log = Log.objects.filter(
topic_0='0x09516ecf4a8a86e59780a9befc6dee948bc9e60a36e3be68d31ea817ee8d2c80',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps, move this to this file as a constant?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes! done, thanks

@sparrowDom sparrowDom merged commit 91c39ab into master Dec 1, 2022
rebase_log = get_rebase_log(block_number)
explode_log_data(rebase_log.data)

credits_per_token = explode_log_data(rebase_log.data)[2]
Copy link
Contributor

Choose a reason for hiding this comment

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

💥

Copy link
Member Author

Choose a reason for hiding this comment

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

some of our code is so dramatic 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants