chaingraph icon indicating copy to clipboard operation
chaingraph copied to clipboard

Support relationships for identifying which transactions replaced other transactions

Open bitjson opened this issue 4 years ago • 1 comments

When inspecting node_transaction_history, it's not trivial to identify which transaction replaced the transaction identified by a node_transaction_history row. It would be nice to add a node_transaction_history.replaced_by field (to go with replaced_at) which has an object relationship to the replacing transaction.

It would also be possible to add a transaction.replaced array relationship to identify all node_transaction_historys which a particular transaction replaced (can be multiple if multiple nodes initially verified other transactions before accepting a replacement transaction in the next block).

bitjson avatar Nov 19 '21 21:11 bitjson

Unless we change the data model, I think this probably requires indexes on replaced_at and/or validated_at to performantly identify replacing transactions.

bitjson avatar Nov 19 '21 22:11 bitjson