Skip to content

feat: unlimited pending sign txs whitelist#31

Open
olga24912 wants to merge 10 commits intoomni-mainfrom
unlimited_txs
Open

feat: unlimited pending sign txs whitelist#31
olga24912 wants to merge 10 commits intoomni-mainfrom
unlimited_txs

Conversation

@olga24912
Copy link
Copy Markdown

OmniBridge acts as the sender for all withdraw transactions. Previously, an account could only have one pending-sign transaction at a time — it had to wait for MPC signing to complete before creating another. This became a bottleneck for
OmniBridge, which needs to submit new withdrawals in parallel while existing ones are still being signed.

  • Replaced btc_pending_sign_id: Option with btc_pending_sign_ids: HashSet to support multiple pending-sign transactions per account.
  • Added unlimited_txs_white_list — a DAO-managed whitelist of accounts that can bypass the single-pending-tx restriction. Non-whitelisted accounts retain the original behavior.

#[cfg_attr(not(target_arch = "wasm32"), derive(Debug))]
pub struct Account {
pub account_id: AccountId,
pub btc_pending_sign_ids: HashSet<String>,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the max allowed size of the btc_pending_sign_ids? I think we still have some limits due to the gas limitation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

fixed: 677420e

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the design will be more flexible if we put this value into the multi_txs_white_list map.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

By doing this we can remove the max_pending_sign_txs from the config.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

fixed: 371e6a9


pub fn internal_get_account(&self, account_id: &AccountId) -> Option<&Account> {
self.data().accounts.get(account_id).map(Into::into)
pub fn internal_get_account(&self, account_id: &AccountId) -> Option<Account> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why we return cloned version now?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I just decided to implement a lazy account migration. If we request mut, we upgrade the account to the new version. If it’s view, we convert it locally. Because of this approach, we can’t return a reference, since a conversion happens.

As an alternative, we could implement a separate migration function and migrate accounts in batches. But I kind of like the lazy approach more.

@olga24912 olga24912 requested review from frolvanya and karim-en April 13, 2026 10:37
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