A context has `current_block_num` value greater than `irreversible_block` value
How to repeat?
- Prepare an empty database.
CREATE EXTENSION hive_fork_manager CASCADE;
SELECT hive.app_create_context( 'any_context' )
SELECT hive.app_context_detach( 'any_context' )
SELECT hive.app_context_attach( 'any_context', 1550 )
Now the context any_context
has: current_block_num
=1550 and irreversible_block
=0.
Description
For SELECT * FROM hive.irreversible_data
we have consistent_block=null
, but in hive.app_context_attach
we have a check
IF _last_synced_block > __head_of_irreversible_block THEN
RAISE EXCEPTION 'Cannot attach context % because the block num % is grater than top of irreversible block %'
, _context, _last_synced_block, __head_of_irreversible_block;
END IF;
How to solve?
We have 2 options:
- a) checking null in above condition
- b) a first record in
hive.irreversible_data
should haveconsistent_block=0