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

Reduce network by only fetching block meta instead of whole block #267

Conversation

grooviegermanikus
Copy link
Collaborator

@grooviegermanikus grooviegermanikus commented Jan 8, 2024

changes:

  • renamed stuff
  • added cleanup for map
  • added logging
  • remove obsolete match for Block

_ = cleanup_tick.tick() => {
let size_before = recent_confirmed_blocks.len();
recent_confirmed_blocks.retain(|_blockhash, block| {
block.slot > current_slot - 100 // must be greater than finalized slot distance (32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a good idea, In some cases it takes time to finalize like if there are some complicated bank forks. So current_slot should be last_finalized_slot

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah! very good point. my logic was very wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should be fixed now

godmodegalactus
godmodegalactus previously approved these changes Jan 8, 2024
@godmodegalactus godmodegalactus dismissed their stale review January 8, 2024 14:07

The merge-base changed after approval.

@grooviegermanikus grooviegermanikus dismissed godmodegalactus’s stale review January 11, 2024 12:16

The merge-base changed after approval.

@godmodegalactus godmodegalactus merged commit 185cbd3 into main Jan 11, 2024
3 checks passed
@godmodegalactus godmodegalactus deleted the reducing_network_usage_by_fetching_only_finalized_blockmeta-groovie branch January 25, 2024 15:19
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.

2 participants