Skip to content

new operation_id generation scheme for hive.operations

Bartek Wrona requested to merge minew_operation_id into develop

operation id is now created with encoding block num, operation type and operation number in block into 64 bit value. This allows to apply several opts:

  • try to lookup for block-specific operations by specifying operation_id between <block_num, 0, 0> and <block_num, 0xFF, 0xFFFFFF>
  • same could be done by composing op_type_id into constant above
  • then we can try remove block_num, op_type_id fields from table storage and define them only at access views like hive.operations_view, hive.account_operations_view and all app-context specific views. The drawback is lacking of virtual column support in Postgres (which exists but really requires a storage what is a nonsense)

This also solves a problem related to nondeterministic values of operation-ids which now finally can have different values for each HAF instance depending on forks (because old solution is always incrementing a sequence providing values for operation-id)

Edited by Bartek Wrona

Merge request reports