Skip to content
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

[Feature]: Poll completed-deposits contract map prior to submitting complete-doposit contract call #1155

Open
cylewitruk opened this issue Dec 18, 2024 · 0 comments
Labels
sbtc signer binary The sBTC Bootstrap Signer.

Comments

@cylewitruk
Copy link
Member

cylewitruk commented Dec 18, 2024

Feature - Poll completed-deposits contract map prior to submitting complete-doposit contract call

1. Description

To help avoid wasting fees on failed complete-deposit contract calls due to replay, we could use the getmapentry Stacks RPC to poll the completed-deposits map in the registry contract to check if the node's view of the contract has already seen the contract call, and avoid submitting it again.

The map could be checked together with the deposit outpoint:

;; Data structure to map successful deposit requests
;; to their respective sweep transaction. Stores the
;; txid, burn hash, and burn height.
(define-map completed-deposits {txid: (buff 32), vout-index: uint}
	{
		amount: uint,
		recipient: principal,
		sweep-txid: (buff 32),
		sweep-burn-hash: (buff 32),
		sweep-burn-height: uint,
	}
)
@cylewitruk cylewitruk added the sbtc signer binary The sBTC Bootstrap Signer. label Dec 18, 2024
@cylewitruk cylewitruk added this to the sBTC: Nice to have milestone Dec 18, 2024
@cylewitruk cylewitruk added this to sBTC Dec 18, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in sBTC Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sbtc signer binary The sBTC Bootstrap Signer.
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant