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

[NONEVM-714] [solana] - Add multiple blocks aggregation functionality to Block History Estimator #896

Merged
merged 35 commits into from
Nov 4, 2024

Conversation

Farber98
Copy link
Contributor

@Farber98 Farber98 commented Oct 18, 2024

Description:

This PR Introduces the MultipleBlocksEstimator that tries to get the desiredBlockCount most recent blocks to determine a more stable compute unit price.

How It Works:

  • Configuration: BlockHistorySize is used to configure this estimator.

  • Fetch Recent Blocks: Tries to retrieve specified number of the latest confirmed blocks from latest slots based on the configured BlockHistorySize. Not all slots have a block.

  • Concurrent Processing:: Fetches each block concurrently while limiting the number of simultaneous operations to prevent rate limiting.

  • Extract and Aggregate Fees: Parses each block to extract compute unit prices from transactions. Calculates the median compute unit price for each block.

  • Determine Overall Average: Aggregates the median prices from all fetched blocks. Computes the overall average to set as the current base compute unit price, ensuring it stays within predefined minimum and maximum config limits.

Merge together with:

pkg/solana/txm/txm.go Outdated Show resolved Hide resolved
@aalu1418 aalu1418 merged commit 39cabce into develop Nov 4, 2024
35 checks passed
@aalu1418 aalu1418 deleted the nonevm-714-multiple-blocks-bhe branch November 4, 2024 20:21
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.

4 participants