-
Notifications
You must be signed in to change notification settings - Fork 71
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
[4.0] Restore read-mode=speculative #986
Conversation
if ( read_mode == db_read_mode::HEAD ) { | ||
EOS_ASSERT( head->block, block_validate_exception, "attempting to pop a block that was sparsely loaded from a snapshot"); | ||
} | ||
EOS_ASSERT( head->block, block_validate_exception, "attempting to pop a block that was sparsely loaded from a snapshot"); |
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.
Seems like this should always be asserted even for IRREVERSIBLE mode.
…ead-mode=speculative
@@ -120,11 +120,17 @@ Config Options for eosio::chain_plugin: | |||
applied to them (may specify multiple | |||
times) | |||
--read-mode arg (=head) Database read mode ("head", | |||
"irreversible"). | |||
"speculative", "irreversible"). |
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.
As speculative is deprecated, place it after irreversible
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.
Done
contains state changes by transactions | ||
in the blockchain up to the head block | ||
as well as some transactions not yet | ||
included in the blockchain. |
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.
Can you specify if a transaction will be replayed, to be consistent with the other two's description?
"In \"head\" mode: database contains state changes up to the head block; transactions received by the node are relayed if valid.\n" | ||
"In \"speculative\" mode: (DEPRECATED: head mode recommended) database contains state changes by transactions in the blockchain up to the head block as well as some transactions not yet included in the blockchain.\n" |
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.
place it after irreversible
Restore deprecated
read-mode=speculative
that was removed in #414.read-mode=head
remains the default.Although,
read-mode=speculative
can cause confusion to users, this PR restores the option as an alternative non-defaultread-mode
. This does not restore persisted trxs. Persisted trxs were API trxs re-applied for each block. This new restoredspeculative
mode therefore will not have the state of API trxs auto applied at the start of each speculative block. It is up to the user to re-apply any transactions at each speculative block in order to observe their side-effects.Also the restored
read-mode=speculative
does not, unlike the old removedread-mode=speculative
, apply schedule changes, protocol activations, oronblock
trxs for a speculative mode into the speculative block which will be aborted when a new block is received from the network. This is in alignment withread-mode=head
.Resolves #980