#Can anyone explain what Bucket List is in depth?
1 messages · Page 1 of 1 (latest)
Can anyone explain ELI5 what Bucket List is in depth?
Can anyone explain what Bucket List is in depth?
I would start with the documentation here, it's fairly informative: https://github.com/stellar/stellar-core/blob/master/src/bucket/BucketList.h
This talk by @west pagoda is also very helpful https://www.youtube.com/watch?v=Xhyjp-UVYRU&ab_channel=StellarDevelopmentFoundation
Speaker: Garand Tyson, Software Engineer Stellar Development Foundation
How can I pull and view data from it?
There is no straightforward way to do this outside of stellar core. There have been some discussions on developing a more dev friendly way of accessing. Do you have a specific use case in mind?
thanks I will go through these docs properly. So I have been making a fee simulator, to estimate fee perfectly.
https://feesimulator.vercel.app
But currently what I have built is imperfect, and the output is not that proper and might have mistakes so I am digging deep into the parameters that affect fees. So If I used bucket list size as a input parameter while estimation, I could possibly predict near perfect fees for a tx for a given ledger, as supposedly from the CAP-46-07 it is clear that the write fees depend on bucket list while it is being calculated.
https://github.com/stellar/rs-soroban-env/blob/164757123268943d9c16059c0124ef113a74f2aa/soroban-env-host/src/fees.rs#L241
I could also track the bucket list size and its effect on the average fees as a datapoint using zephyr
cc @tall ginkgo
ah, bucket list size is much simpler and you don't actually need to worry about its underlying structure (moreover, it's subject to change in the future, as well as the fee computation method).
both bucket list size and the write fee are emitted in tx meta every ledger. I would recommend just consuming the write fee directly, but it requires an additional flag to be set in the Core instance that produces meta. just give me a moment to find all the links
https://github.com/stellar/stellar-xdr/blob/529d5176f24c73eeccfa5eba481d4e89c19b1181/Stellar-ledger.x#L497 - here is the write fee, it's a part of LedgerCloseMeta.v1.ext.v1
EMIT_LEDGER_CLOSE_META_EXT_V1 = true is the flag one needs to add to the Stellar Core config in order to get the field above populated (you can find it here: https://github.com/stellar/stellar-core/blob/a71f88d622ac07d911944e53492864e177db2b9e/docs/stellar-core_example.cfg, github doesn't allow me linking to the exact line, so just use search)
https://github.com/stellar/stellar-xdr/blob/529d5176f24c73eeccfa5eba481d4e89c19b1181/Stellar-ledger.x#L529 - that's the bucket list size, if you're curious, but again, I recommend using the write fee directly. it's emitted in meta unconditionally
👍
I took some notes on it a while back, might be helpful
@rocky fable fwiw, if you're interested in getting the actual current bucketlist size for the fees, we could expose that within zephyr, but not sure if it's needed. As dmytro said, using write fee directly is better
this is actually quite great! thanks for sharing