-
Notifications
You must be signed in to change notification settings - Fork 152
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
feat: introduce txid->blockhash index on IStore #1328
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1328 +/- ##
==========================================
- Coverage 86.03% 76.93% -9.11%
==========================================
Files 361 253 -108
Lines 32457 16945 -15512
==========================================
- Hits 27925 13036 -14889
- Misses 2747 3380 +633
+ Partials 1785 529 -1256
|
/rebase |
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.
Please update this branch to main and resolve conflicts. 🙇♂️
/rebase |
0807d29
to
cc49741
Compare
public override void PutTxIdBlockHashIndex(Guid chainId, TxId txId, BlockHash blockHash) | ||
{ | ||
var cf = GetColumnFamily(_chainDb, chainId); | ||
_chainDb.Put( |
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.
if we decide to store these indexes on chainDb
, we also need to add a new method for forking because we can delete the previous chainDb
after forking...
Or, how about using the separated DB for storing?
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.
I was thinking that It(forking
) is handled by other codebases.
And I realized that the chain id may not be needed. So the forking
also not needed.
please see the patch 5f43072
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.
Yes, if we don't put it with ColumnFamily
, there is no matter. 😄
The chain id may not be needed for this change. Please see the patch 5f43072 public void PutTxIdBlockHashIndex(TxId txId, BlockHash blockHash);
public bool HasTxIdBlockHashIndex(TxId txId);
public BlockHash? GetTxIdBlockHashIndex(TxId txId);
public void DeleteTxIdBlockHashIndex(TxId txId); IMHO, TxId->BlockHash index can be handled like TxExecution. |
The APIs were changed according to your advice @longfin
void PutTxIdBlockHashIndex(TxId txId, BlockHash blockHash);
BlockHash? GetFirstTxIdBlockHashIndex(TxId txId);
IEnumerable<BlockHash> IterateTxIdBlockHashIndex(TxId txId);
void DeleteTxIdBlockHashIndex(TxId txId, BlockHash blockHash); |
/// <inheritdoc cref="BaseStore.PutTxIdBlockHashIndex(TxId, BlockHash)"/> | ||
public override void PutTxIdBlockHashIndex(TxId txId, BlockHash blockHash) | ||
{ | ||
_txExecutionDb.Put( |
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.
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.
PTAL |
PTAL. @longfin @dahlia @greymistcube @limebell @riemannulus CI passed except for Codecov test coverage. |
Can you tell me when |
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.
Everything else looks fine.
The API responds to the caller that a transaction is included in at least one block or not. It has a similar use case like |
/rebase |
closes #1294
APIs
Following APIs are added to
IStore
Contract
reorg
situation.)