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

Invariant check bounty #22

Merged
merged 1 commit into from
Aug 19, 2022
Merged

Invariant check bounty #22

merged 1 commit into from
Aug 19, 2022

Conversation

blazeroni
Copy link
Contributor

@blazeroni blazeroni commented Aug 10, 2022

This is a claim for the invariants check bounty.

I know the bounty says to provide multiple proofs, but simply running running junod on the genesis file is a quick enough test. Instead of 10 hours, it now takes about 30 seconds - less than 1% of the previous time.

The root problem was not the sequential nature of the invariant checks, but one particular method used by the "can-withdraw" check. The issue is fairly deep in the cosmos code -- ultimately it was an issue with a cache not getting processed appropriately.

I submitted a PR (cosmos/cosmos-sdk#12885) on cosmos-sdk which contains a fix for this issue. It amortizes the cost of processing cache entries and speeds things up dramatically. Since it's a lower level fix, it may also improve/prevent other issues unrelated to this specific issue.

You can get a build of junod with the change included here: (https://github.com/blazeroni/juno-bounty/tree/v9.0.0-invariants).

Let me know if you have any questions or need any more info. Cheers!

@the-frey
Copy link
Contributor

Thanks for this submission! We will keep an eye on the upstream progress/merge.

In the meantime, we'll run the build you've provided (cheers!) to verify at our end.

@blazeroni
Copy link
Contributor Author

blazeroni commented Aug 18, 2022

@the-frey the fix has been merged into cosmos-sdk. It's also being backported to 0.45.x and 0.46.x.

Let me know if there's anything else you need from me.

@JakeHartnell JakeHartnell merged commit 92fb06d into CosmosContracts:main Aug 19, 2022
@onivalidator
Copy link

@blazeroni Can you please confirm your Juno address for the invariants bounty by signing a transaction (https://juno.tools/sign-verify/) from the wallet you provided?

@blazeroni
Copy link
Contributor Author

@onivalidator sure, here's the wallet, message, and signature:

juno168njtnauuyd0rjh5cdp2hls762enz2lqn2453u
invariant bounty
J/7MxAu7rO7QQqPlpxj4k7ER9yrQYXMr1GBNSUGUwSo7mo8Z4wTaUYXp0Ya6Hzy0ADxZDC1soQ7TVlXHvHRlhA==

@blazeroni
Copy link
Contributor Author

@onivalidator any update on this?

@onivalidator
Copy link

@blazeroni Bounty payment is currently up for vote through the Core-1 DAODAO. You can follow along here (https://daodao.zone/dao/juno1gpwekludv6vu8pkpnp2hwwf7f84a7mcvgm9t2cvp92hvpxk07kdq8z4xj2/proposals/A10). There's a 50% bonus on top of base bounty for pure excellence in speeding up the invariant checks.

@blazeroni
Copy link
Contributor Author

@onivalidator great, thank you!

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