Fix#362 by replacing non-deterministic hashed indexes with ordered
indexes
Remove HARDFORK check for witness ordering because this #362 will
require a test net reset to effeciently implment.
Changed the order in wich process_fees iterates accounts to be "by_name"
rather than "by_id" so that we retain the ability to switch back to
hashed indexes in the future.
This change was overly pestimistic and assumes all indexes may be
traversed as part of consensus. We want to reserve the ability to
change some of the indices back to hashed indicies in the future after a
through audit reveals that they are never iterated over in order.
The pending_block member of database was a premature optimization and had an
unfortunate tendency to get out of sync, especially when switching forks.
This commit removes it, and substantially improves the handling of transactions
when switching forks. Specifically, flooding or forking no longer causes nodes to
discard valid transactions.
- update fc to fix crash in websocket message handling
- added api to verify transactions without broadcasting them
- added api to broadcast a block produced outside the P2P network or
witness
- with this change the fork database now caches blocks that do not link
and attempts to link the unlinked blocks after every new block is
successfully linked.
- with this change the fork database only tracks blocks as far back as
the undo history allows. This significantly reduces memory usage when
there is high witness participation.
When subscribing to an account via the get_full_account API it will
start streaming any object relevant to the account that is added,
removed, or modified.
The blockchain now has a minimal participation requirement that can only
be overridden with checkpoints. Any time participation falls below a
minimal level no new blocks may be added.
Currently it requires 66% participation and tolerates short periods of
time below 66% participation with a maximum of 500 consecutive blocks
missed. For every two blocks produced 1 can be missed with a slack of
999 bias.
This is done to comply with the policy that transactions should be self
describing and not depend upon implied state. This makes things easier
for everyone to understand exactly when a transaction will be invalid
without having to refer to chain state.
1. Implement a TaPoS assert operation predicate that offers full block ID
validation for transactions that want the added security. This is only
required for transactions that are of high value and transfer control of
funds to a newly created identifier and where the witnesses cannot be
trusted.
2. Remove the full block ID from the transaction digest generation.