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

Bank maintains state outside of Accounts #2210

Closed
aeyakovenko opened this issue Dec 18, 2018 · 3 comments
Closed

Bank maintains state outside of Accounts #2210

aeyakovenko opened this issue Dec 18, 2018 · 3 comments

Comments

@aeyakovenko
Copy link
Member

Problem

Due to rollback, any state outside of Accounts cannot be maintained as consistent. Any state must be computed from the Accounts structure from a desired checkpoint.

Proposed Solution

  • move the state out of Bank
  • write functions of the form fn compute_state(bank: &Bank) -> DesiredState

things that need to be moved:

  • finality_time (this might be able to stay in the bank)
  • account_subscriptions/signature_subscriptions (needs to specify confirmation depth?)
  • leader_scheduler (should just be recomputed every time, this should only run once a day)
  • storage_state (not sure)

tag: @mvines @carllin @CriesofCarrots @sakridge

@garious garious added this to the The Future! milestone Jan 3, 2019
@garious
Copy link
Contributor

garious commented Jan 3, 2019

@aeyakovenko, have you seen test_hash_internal_state() in bank.rs? Specifically, are you looking for: (bank.last_id(), bank.hash_internal_state())?

@aeyakovenko
Copy link
Member Author

aeyakovenko commented Jan 3, 2019

@garious it is a bit more complicated. We basically need to define a TVU bank and a TPU bank. Which are the global bank state forks for those units. Computations that depend on either should reference those, but we also have some computation that is derived just from whatever fork is being proposed at the moment. To make it easier to manage this in a way that isn't tied to a specific consensus algorithm, the computations should just take a bank fork as a parameter.

@garious
Copy link
Contributor

garious commented Jan 16, 2019

@rob-solana, I assigned this one to you under the assumption it's part of what you're already doing as part of taking over #2289.

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

No branches or pull requests

3 participants