-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
IAVL Gas pricing #2860
Labels
Comments
21 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently our IAVL gas pricing is a bit naive. Its pricing model currently is a flat "get" fee, plus some cost per byte read. However the work is really
constant overhead + O(depth) + db read per byte + rebalance cost at a given depth
.We should definitely have a cost per depth, since these are extra reads that are required.
For rebalancing, there are a couple options, either amortize the rebalance cost over the minimal number of operations until next rebalance, have a full rebalance charge at once, or make some metric to determine how much closer to a rebalance its being pushed. There are downsides to both:
n
, I can typically make it rebalance withn/2
deletes, but on average it will take more operations to force it to rebalance. This also complicated, since you have to do this calculation for every depth.The text was updated successfully, but these errors were encountered: