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

Clear Transient Store in EndBlock instead of Commit #2320

Closed
rigelrozanski opened this issue Sep 13, 2018 · 12 comments
Closed

Clear Transient Store in EndBlock instead of Commit #2320

rigelrozanski opened this issue Sep 13, 2018 · 12 comments

Comments

@rigelrozanski
Copy link
Contributor

rigelrozanski commented Sep 13, 2018

Simultaneous to this we should also turn off commit's during simulation, which really slows things down and needed to be turned on in #2310

CC @mossid

Some convo's around this:

@rigelrozanski
I think organizationally speaking it makes more sense to exist in Commit as that’s the point for the store operations (this is the current implementation of Transient Store). EndBlock I see more for application logic closing operations. It would be feasible for it to exist in either I believe though
@ValarDragon:
I kind of feel like it would make sense to clear the Transient Store in EndBlock, as its really just there to provide a performance increase for things the app may want to query at various times intra-block. Commit is for persisting what must needs to be written disk. (Though I do see your point, as its still very much in the realm of things Commit handles)
Given that theres a motivation for clearing the transient store in EndBlock though (faster simulations, which I think is valuable), I think it we should move it there.
(This shouldn't block your PR being merged post-review though!)

@mossid
Copy link
Contributor

mossid commented Sep 14, 2018

I'm currently working on #2309 so after then transientStore will be exposed. EndBlock can read a KVStore from the Context then typeassert it to TransientStore, being able to manually Wipe() on it.

One problem here is that we are going to wrap the store with GasKVStore, PrefixStore, etc, making it hard to typeassert. Maybe we can add a method like KVStore.Base which returns the innermost store.

@alexanderbez
Copy link
Contributor

Can all the wrappers just delegate the Type method to their "parent"?

@mossid
Copy link
Contributor

mossid commented Sep 15, 2018

By Type you mean Store.GetStoreType()?

@alexanderbez
Copy link
Contributor

Ahh yes @mossid 👍

@alexanderbez
Copy link
Contributor

@rigelrozanski any updates on you share on this?

@rigelrozanski
Copy link
Contributor Author

I think this can be postlaunch potentially even - the only reason this was ever a priority is because we needed TendermintUpdates (in staking) to be cleared from the transient store for the simulations - but because this is no longer relevant after the staking refactor, this is not priority - HOWEVER what is still priority is removing commits from the simulation - this should be prelaunch.

@ValarDragon
Copy link
Contributor

Don't we still need this to remove commits from the simulation, since there is a transient store key used for params?

@rigelrozanski
Copy link
Contributor Author

rigelrozanski commented Sep 26, 2018

ah maybe - we probably should update the sim to be as close to real execution as possible

@jackzampolin
Copy link
Member

Is this still something we want to do? I'm going to move this to if have time...

@rigelrozanski
Copy link
Contributor Author

👍 this is def. if-have-time

@rigelrozanski
Copy link
Contributor Author

CC @mossid - is it now possible to easily implement this?

@rigelrozanski rigelrozanski added this to the v1.0 LTS milestone Jun 20, 2019
@jackzampolin
Copy link
Member

I don't know if this is still needed. Going to go ahead and close this issue. Please reopen with actionable steps if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants