-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: improve performance BTC reward distribution #306
Conversation
…improve-performance-btc-dist
…otal amount of satoshi staked as sdkmath.int
… need the total to create new delegation
…improve-performance-btc-dist
…distribution testing
…improve-performance-btc-dist
…improve-performance-btc-dist
… (needed to create a new set of keys to store map of del => fp address)
…improve-performance-btc-dist
…thdraw > getting crazy in amounts calculation .-.
…hi active/unbonded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me 👍 great work pushing it forward :)
Lets wait for at leas one more approval before merging given size of the pr :)
@SebastianElvis @gitferry Addressed all the comments 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on the improvement! Some minor comments, no blocker:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work!
BTCDelegationStatus_EXPIRED
for BTC delegations that indicates a BTC delegation is no longer contributing to securityproto/babylon/incentive/rewards.proto
x/finality/keeper/power_dist_change.go
x/incentive/keeper/btc_staking_gauge.go
x/incentive/keeper/grpc_query.go
x/incentive/keeper/msg_server.go
x/incentive/keeper/reward_tracker.go
x/incentive/keeper/reward_tracker_store.go
x/btcstaking/keeper/btc_delegations.go
x/btcstaking/keeper/msg_server.go
x/btcstaking/types/btc_delegation.go
Benchmarks
Command to generate pprof
go tool pprof -http=:8080 http://localhost:6060/debug/pprof/profile\?seconds\=300
rafilx/improve-performance-btc-dist
with 100k BTC delegations, took 6.73s (1.8%) of the time during the 300seconds intervalNote that the percentage of the time used that is ~7x lower should be considered instead of the time, the benchmark from
main
was running in the benchmark server 48 processors and 256GB of RAM while the one in the current branch I run locally with 24 processors and 96GB of RAM.... So the percentage of the time usage instead of seconds should be the one in comparison