-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add Failed sui_tx_id to db when status is finalized failed #146
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Rayane Charif <[email protected]>
Reviewer's GuideThis PR refactors the Sui minting client to return structured success/digest results, updates the indexer and storage layers to persist failed transaction digests and statuses, and adjusts tests to accommodate and verify the new failure handling logic. ER diagram for nbtc_minting table updateserDiagram
NBTC_MINTING {
tx_id varchar
vout int
block_hash varchar
block_height int
sui_recipient varchar
amount_sats int
status varchar
created_at int
updated_at int
retry_count int
sui_tx_id varchar
}
Class diagram for updated SuiClient minting methodsclassDiagram
class SuiClient {
+mintNbtc(transaction, blockHeight, txIndex, proof): SuiTxDigest
+tryMintNbtc(transaction, blockHeight, txIndex, proof): SuiTxResult
+mintNbtcBatch(mintArgs): SuiTxDigest
+tryMintNbtcBatch(mintArgs): SuiTxResult
}
class SuiTransactionError {
+suiTxDigest: string
}
class SuiTxResult {
+success: boolean
+digest: string
}
SuiClient --> SuiTransactionError
SuiClient --> SuiTxResult
Class diagram for updated Indexer.processFinalizedTransactions logicclassDiagram
class Indexer {
+processFinalizedTransactions()
}
Indexer --> SuiClient : uses
Indexer --> Storage : uses
Class diagram for updated CFStorage.batchUpdateNbtcTxs methodclassDiagram
class CFStorage {
+batchUpdateNbtcTxs(updates)
}
CFStorage --> D1Database : uses
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Signed-off-by: Rayane Charif <[email protected]>
sczembor
left a comment
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.
we should continue using tryMintNbtcBatch and handle the results there, and return a tuple (succes | failure, txDigest |null). And then the invoking funciton should decide what to do with it
Signed-off-by: Rayane Charif <[email protected]>
sczembor
left a comment
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.
the logic is incorrect
Signed-off-by: Rayane Charif <[email protected]>
… sui network Signed-off-by: Rayane Charif <[email protected]>
sczembor
left a comment
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.
The error handling is still not clear, its a little bit too complex, which is not needed. We already inspect the effects. Please take a look at what the code already does
Signed-off-by: Rayane Charif <[email protected]>
Signed-off-by: Rayane Charif <[email protected]>
sczembor
left a comment
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.
left few comments
Signed-off-by: Rayane Charif <[email protected]>
Signed-off-by: Rayane Charif <[email protected]>
Signed-off-by: Rayane Charif <[email protected]>
Signed-off-by: Rayane Charif <[email protected]>
Signed-off-by: Rayane Charif <[email protected]>
sczembor
left a comment
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.
this is still incorrect, we treat all on chain aborts as successful mints
957a702 to
fa81e3e
Compare
Description
Closes: #137
Research on the possible scenarios:
Without digest: Pre-submission errors (network failures, invalid transactions, RPC timeouts) - transaction never reached Sui network.
With digest: Execution errors (insufficient gas, object conflicts, Move runtime errors, wrong package_id call ..) - transaction was submitted and assigned a digest but failed during execution.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdSummary by Sourcery
Record and propagate Sui transaction digests for batch mint operations, including capturing and storing the digest on failures
New Features:
Enhancements:
Tests: