Skip to content

docs: Implement ADR-001: Smart Transaction Submission#706

Draft
ducpm2303 wants to merge 11 commits intomainfrom
feat/tx-submission-enhancement
Draft

docs: Implement ADR-001: Smart Transaction Submission#706
ducpm2303 wants to merge 11 commits intomainfrom
feat/tx-submission-enhancement

Conversation

@ducpm2303
Copy link
Copy Markdown
Contributor

@ducpm2303 ducpm2303 requested a review from satran004 October 7, 2025 04:52
@satran004
Copy link
Copy Markdown
Member

@matiwinnetou We have started drafting the spec to enhance the current transaction submission endpoint with rollback awareness capability. In the initial phase, we plan to store submitted transactions and monitor a certain number of blocks for confirmation. If a rollback occurs, the system may resubmit the same signed transaction and notify the application.

Feel free to review it, and if you have any specific requirements, please add your comments here.

└────│ ROLLED_BACK │ ← RollbackEvent detected
└──────┬───────┘
│ Can return to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have twice confirmed here, there should be "FINAL" state at the bottom.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @matiwinnetou . The second CONFIRMED state is for re-submission after a rollback.

Agree. We should introduce a FINALIZED state, which is set after 2,160 blocks (security parameter in genesis file) when the block becomes truly immutable.

SUCCESS is determined by the number of block confirmations configured according to the application’s requirements. This can vary across applications. We can either define a single property for the number of confirmations or make it transaction specific.

We also need an efficient way to transition the status from SUCCESS to FINALIZED after 2160 blocks. The watch scheduler stops after SUCCESS, but perhaps another method could periodically check for transactions that are eligible to move to the FINALIZED state after each new block.

@ducpm2303

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watcher for sure should not stop after SUCCESS, it should monitor until FINALIZED, this is how we did this in Reeve back in the days.

cbor_hex TEXT NOT NULL,

status VARCHAR(20) NOT NULL,
-- Values: SUBMITTED, CONFIRMED, SUCCESS, FAILED, ROLLED_BACK
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FINALIZED as a new status?

Maybe we could also introduce partial completion. For a lot of use cases, like 10 blocks would already give strong enough indication it is fine. This is what we doing in REEVE, special status after 10 blocks. FINALIZED is after mathemetically finalising it according to Ouroboros Prasos or in the future consider Ouroboros Peras, which will have likely different finality. So ideally solution should be prepared for Ouroboros Peras.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need a FINALIZED status. please check my previous comment.

…support

- Introduced a new `submit` component for smart transaction submission with lifecycle tracking.
- Implemented transaction states: SUBMITTED, CONFIRMED, SUCCESS, FINALIZED, FAILED, and ROLLED_BACK.
- Added REST API endpoints for submitting transactions and querying their status.
- Integrated WebSocket support for real-time notifications on transaction status updates.
- Configured lifecycle properties and database schema for tracking submitted transactions.
- Enhanced the build configuration to include new dependencies for WebSocket and Hibernate types.
@ducpm2303 ducpm2303 marked this pull request as draft October 12, 2025 18:43
…TxSubmissionService

- Removed the SmartTxSubmissionService, consolidating transaction submission logic into TxLifecycleService.
- Updated TxLifecycleController to utilize TxLifecycleService for transaction submissions.
- Enhanced TxLifecycleService to handle transaction submission and lifecycle tracking directly.
- Cleaned up unused imports and methods in OgmiosService and TxSubmissionService.
…hook, and Event Log support

- Added WebSocket and Webhook notification channels for real-time transaction status updates.
- Introduced an Event Log for auditing transaction status changes, including database schema for event logging.
- Enhanced SubmitLifecycleProperties to include configurations for webhook and event log settings.
- Created interfaces and implementations for notification channels, allowing for extensibility in future notification methods.
- Updated application configuration to support new notification features.
- Introduced new methods in TxLifecycleService for finding existing transactions, confirmed transactions after a specific slot, and transactions by status and confirmed block number.
- Updated TxLifecycleProcessor to utilize the new service methods for improved transaction status updates.
- Refactored SubmittedTransactionRepository to support new query methods for transaction management.
- Removed unnecessary inheritance from BaseEntity in SubmittedTransactionEntity and TxEventLogEntity for cleaner model definitions.
@ducpm2303 ducpm2303 marked this pull request as ready for review October 21, 2025 07:47
@sonarqubecloud
Copy link
Copy Markdown

@ducpm2303 ducpm2303 marked this pull request as draft November 17, 2025 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants