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

Handle meta events #3070

Open
roman-khimov opened this issue Dec 25, 2024 · 3 comments
Open

Handle meta events #3070

roman-khimov opened this issue Dec 25, 2024 · 3 comments
Assignees
Labels
feature Completely new functionality I2 Regular impact S1 Highly significant U1 Critically important to resolve quickly
Milestone

Comments

@roman-khimov
Copy link
Member

Is your feature request related to a problem? Please describe.

A part of #2878.

Describe the solution you'd like

Add meta event handling:

Describe alternatives you've considered

There can be some, but we need this data to be processed fast and we'll need MPT for subsequent synchronization.

@roman-khimov roman-khimov added U1 Critically important to resolve quickly S1 Highly significant I2 Regular impact feature Completely new functionality labels Dec 25, 2024
@roman-khimov roman-khimov added this to the v0.45.0 milestone Dec 25, 2024
@roman-khimov
Copy link
Member Author

@AnnaShaleva and @AliceInHunterland can tell a bit more about the way storage is handled in NeoGo. What we're doing here is very similar to storeBlock except that we work with events and some data needs to be obtained additionally (but it's not a part of the state proper at the same time).

@carpawell
Copy link
Member

@roman-khimov

  1. So we have a new DB now for our indexes (not sure why it is a reuse of neo-go's one but ok, dont mind) and also have a MemCachedStore memory instance for every block, why? That is exactly "cached" version, not just a memory instance per block, right? Over what is it created, the original disk DB? What does the cache solve?
  2. "listen for events", "for each block". What is this new DB subscribed for? I thought that it should receive only our new events from meta-on-chain TXs but it also needs to process every block?
  3. "these prefixes are added into https://pkg.go.dev/github.com/nspcc-dev/[email protected]/pkg/core/mpt". What exact "these prefixes"? Why we need mpt here?
  4. "full header index ... not be a part of MPT" what is the criterion of what mpt and what is not?

@roman-khimov
Copy link
Member Author

  1. It can be done without MemCachedStore using per-block Bolt transactions, but reusing NeoGo storage subsystem allows to simplify some interfaces and make DBs changeable. In future we can also optimize flushing from per-block to something smarter. Memory itself is irrelevant here.
  2. Listen for new events, you need to watch for objects, that's the only thing you care about (epochs are interesting too, but maybe not immediately).
  3. MPT is to identify and synchronize state. Prefixes are those created above, not the full index.
  4. Reproducibility. I can fetch headers and recreate index using data stored in MPT, so adding everything into MPT is a resource waste.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Completely new functionality I2 Regular impact S1 Highly significant U1 Critically important to resolve quickly
Projects
None yet
Development

No branches or pull requests

2 participants