madara
madara copied to clipboard
dev: possibly changing storage architecture
Not sure if storage architecture is the right term here. I'm seeing that to obtain the transaction receipt via get_transaction_receipt
,the logic of doing so is
let find_receipt = block
.transaction_receipts()
.into_iter()
.find(|receipt| receipt.transaction_hash == transaction_hash.into())
.map(|receipt| {
receipt
.clone()
.into_maybe_pending_transaction_receipt(TransactionStatus::AcceptedOnL2, (block_hash, block_number))
});
looping through the receipts in the block O(n)
and populating the output TxReceipt struct. This could work in the case where transaction per block is low but would possibly be expensive should a block has many transactions.
My simple proposal is to store in the db a tx_hash -> transaction body mapping. Of cos there are many things to consider. Trying to get the ball rolling at least
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
repository archived in favor of https://github.com/madara-alliance/madara