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

Move mainStore from baseApp to the Accounts module #925

Closed
ebuchman opened this issue Apr 27, 2018 · 11 comments
Closed

Move mainStore from baseApp to the Accounts module #925

ebuchman opened this issue Apr 27, 2018 · 11 comments
Labels
C:baseapp T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).

Comments

@ebuchman
Copy link
Member

  • main store is used by AccountMappers because they got tied early in development
  • AccountMappers should use an accountStore
  • main store otherwise contains nothing. Do we need a main store ?

Original notion was that the main store would store the header, but turns out we haven't actually needed it (the app gets it in BeginBlock anyways).

Our light client doesnt look for headers in the state (just in the blockchain), though this could be a useful check for the causal order of a state and the blockchain that produced it.

I commented out storing the header in https://github.com/cosmos/cosmos-sdk/blob/master/baseapp/baseapp.go#L143 when I found we didn't need it, because I thought we could get the state root to stay the same across blocks with no transactions. But the new IAVL keeps the version, so the app hash changes every block, so we need to do something else about that anyways:

Should we store the header in the SDK state? Should it go in main, or in a /headers ? Do we need main at all ?

@rigelrozanski
Copy link
Contributor

let's keep this here commented out, but provided that nothing else comes up we should remove this prelaunch. Staking requires both Time and Height which is retrieved from the context, I'm not sure how this relates to the header or if at all.

@gamarin2 @mossid thoughts on what governance/ibc needs?

@gamarin2
Copy link
Contributor

gamarin2 commented May 1, 2018

For gov we also need Height, but the needed block height are stored in the proposals store. I don't think gov module needs this store.

@ValarDragon
Copy link
Contributor

Seems like we should remove it then?

@ValarDragon ValarDragon added the T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). label Sep 23, 2018
@alexanderbez
Copy link
Contributor

I dont think so -- afaict, we only use main in the mock, examples, and a few tests.

@jackzampolin
Copy link
Member

Is this the Paramstore work cc @ValarDragon? And is this still #prelaunch?

@jackzampolin
Copy link
Member

Sounds like thats a yes.

@ValarDragon
Copy link
Contributor

In my opinion, this should be done prelaunch, and is pretty independent of paramstore stuff.

@jackzampolin jackzampolin changed the title main store Move mainStore from baseApp to the Accounts module Dec 7, 2018
@jackzampolin
Copy link
Member

This should be done sooner than later.

@rigelrozanski
Copy link
Contributor

rigelrozanski commented Dec 10, 2018

We're using the mainstore in baseapp now for max-block-gas parameter storage which is needed in baseApp... There is going to be a consistent need for baseApp to have persistent parameters aka it needs access to some kind of store - We've talked about initializing the paramsStore in baseapp, and passing it up to gaia now - At this point we wouldn't need the main store. Not sure if how this interacts with this PR

@ValarDragon
Copy link
Contributor

Consensus params should definitely be tracked in the params store imo. (Or a separate consensus param store if that simplifies param change proposals communicating with tendermint)

@rigelrozanski
Copy link
Contributor

rigelrozanski commented Dec 10, 2018

Yeah it should be there, it's just a larger refactor which doesn't need to be done prelaunch. Here is the tracking issue for this #2882

Until we complete 2882 We're blocked on moving the main store, hence, we should probably move this issue to - postlaunch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:baseapp T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

No branches or pull requests

8 participants