-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add getFeeStats method #172
Conversation
This is still untested but created early to gather feedback. @tamirms I would like to know your opinion on the implementation. Unlike Horizon (which uses Postgres to compute the stats :S), we do everything in Go and book-keep an in-memory data structure. The juicy part is @janewang Thoughts about the API? |
@2opremio in-memory approach makes sense to me especially considering we sample at most 50 ledgers |
I like the idea of For |
@janewang how about |
Actually, we could have |
I still think |
* Enable `ENABLE_DIAGNOSTICS_FOR_TX_SUBMISSION` when enforcing soroban diagnostics (needed for soroban-rpc) * Add `EnforceSorobanTransactionMetaExtV1` toml parameter, so that `EMIT_SOROBAN_TRANSACTION_META_EXT_V1` is enabled by default (needed for soroban-rpcs new `getFeeStats` endpoint). See stellar/soroban-rpc#172 * Mock core version and protocol in tests so that toml generation is more realistic
* ingest/ledgerbackend: tweak enforcing toml parameters and tests * Enable `ENABLE_DIAGNOSTICS_FOR_TX_SUBMISSION` when enforcing soroban diagnostics (needed for soroban-rpc) * Add `EnforceSorobanTransactionMetaExtV1` toml parameter, so that `EMIT_SOROBAN_TRANSACTION_META_EXT_V1` is enabled by default (needed for soroban-rpcs new `getFeeStats` endpoint). See stellar/soroban-rpc#172 * Mock core version and protocol in tests so that toml generation is more realistic * Appease go vet
I will go with |
This is ready for review. @tamirms @sydneynotthecity @janewang PTAL |
What
Add
getFeeStats
method, with the following response data structure:It includes extra fields with respect to #114 (a global
latestLedger
fieldand a
count` field in each distribution, it indicates how many fees were included to compute it).We can, optionally also include the initial ledger used for each distribution if that's interesting (which, together with the global
latestLedger
field, will tell the user what ledger window was used for each distribution).Why
Closes #114
Known limitations
N/A