-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andresberrios Thanks for taking on such an ambitious addition to nodeos
I have a high three level concerns with the signal model as presented that I would like to hear your thoughts on before digging in more.
- The Signals as spec'd do not seem to provide enough information for a downstream consumer to get a consistent view of the state at a particular point in time. For instance if I wanted to query a few different bits of information at "the end of a block A" or "after applying transaction X" there doesn't seem to be enough information produced to achieve this. The information can be used to create a replicated copy of the consensus state that follows the the database pretty closely in realtime but lacks the contextual information needed to understand if a create/update/delete is associated with a certain higher level construct (like a transaction) or a low level construct (like undoing a speculatively executed transaction).
- pulling a page from dmux, if a downstream consumer wanted to "reduce" state into meaningful metadata, perhaps deriving information at state-transitions, this level of signaling does not adequately represent micro forks as orphaned bits outside of consensus. For instance, if Node 1 sees transitions
A -> B -> (C' -> C'-rollback -> )C -> D
where C' is a microfork and Node 2 seesA -> B -> C -> D
it is hard to guarantee that their reduced meta state is equivalent. Put another way, this doesn't abstract away any of the complexity of consensus and (1) implies that you cannot reconstruct a method of handling it downstream. - A more meta concern is that this produces signaling outside of the atomicity of actions. This may create a false value proposition for contract authors to write more often than necessary (multiple times to the same row in a single action). While that is valid, it may present a bad incentive to place more burden on the shared scarce resources of on-chain processing to facilitate off-chain side-effects. I'm not opposed to allowing things like this but, I do want to have a discussion of the trade-offs it creates
Again, thank you for attempting this, it is truly ambitious and starts a very good conversation
Hi there @wanderingbort. Thank you from giving a review to this cuz we really think that this projects needs validation from EOSIO devs to evaluate our expectation and understand is viability. To be honest my ideia (I think Andrés as well) for this plugin at this phase was only to stream the database operations to a queue without any context like trx / block / fork that it belongs to. Same as the chain_plugin fetch's rows every API request and does not take that context in consideration.
Maybe I'm wrong but since I subscribe the undo and emit their reverse operations In theory I'm streaming forks operations and the reverse operations when they are removed / (orphaned?) as well. Should I subscribe events on the reversible_blocks chainbase in controller and fork database push_block and pop_block ?
But the thing is as long there is a use case for tracking this information is ok for me.
Also just realized that there is a new state history plugin being developed by you guys so I'm not sure this is the best way to approach the need to track only table state. |
Thanks @wanderingbort for taking the time to review this. To expand on what @mmcs85 has mentioned: It is true that we initially were looking to only stream the state DB operations, without them needing much associated context like the action/transaction that caused them. This is simply because we were pursuing the use cases where that would be enough, considering that after querying the state, the client could get notified of further modifications to the snapshot that was received via WebSockets or whatever other mechanism that the developer would like to implement or use in the receiver side, thus maintaining a consistent view of the state after any necessary undos are executed. This does not mean that there aren't more use cases that this system can cover very effectively, and that's also why we needed to get in touch with you guys and see what you consider important to support. On top of that, as @mmcs85 explained a bit, we already had some ideas for solutions to support further use cases.
If this behaves as we believe it does, then we shouldn't need any further checks with reversible blocks or the fork database, as all of that would be handled by nodeos and applied to the state chainbase, which we hooked into. Besides this, in some cases, the developer might find it more valuable to run a reducer based on actual applied actions and their parameters instead of state DB operations. In this case, using this plugin, they can simply use the actions DB table. Each applied action will be in this table (which has
There might be other use cases that we're not yet considering, but for most dapp development needs that we've thought of, this implementation fulfills all needs so far. It's also worth mentioning that we've had strong interest in this system from some of the biggest dapps out there, so there's definitely a demand. |
in the time between this PR and now we've successfully created plumbing to allow plugins to exist out of repo. I am going to close this PR as it is stale and should probably exist as a sibling repo that leverages this feature. See #5026 |
Change Description
This PR is for reviewing the implementation of the statetrack_plugin and related code changes to chainbase.
This is an early version of the code and still required more testing. There are various open questions for which we wanted to request feedback from the Block.one developers.
The details on the plugin and motivation are explained in the plugin's readme file: https://github.com/mmcs85/eos/tree/master/plugins/statetrack_plugin
The associated pull request for the chainbase changes is here: EOSIO/chainbase#28
The associated receiver for the operations sent by this plugin is here: https://github.com/andresberrios/statemirror
Consensus Changes
This plugin doesn't directly introduce changes to consensus but there might be some implications regarding transaction processing time limits that should be evaluated. The details are explained in the above referenced plugin readme file.
API Changes
No API changes are introduced, but new hooks would be available for plugins to utilize if the chainbase pull request is merged.
Documentation Additions
Most of the documentation related to the current implementation of the plugin is detailed in the above referenced readme file.