Skip to content

improve: add l2 token splitter and fix Bridge API transfer tracking#3120

Merged
bmzig merged 19 commits intomasterfrom
bz/fixAmount
Apr 10, 2026
Merged

improve: add l2 token splitter and fix Bridge API transfer tracking#3120
bmzig merged 19 commits intomasterfrom
bz/fixAmount

Conversation

@bmzig
Copy link
Copy Markdown
Contributor

@bmzig bmzig commented Mar 26, 2026

This PR makes two changes:

  • Adds a L2 token splitter bridge, which lets us withdraw two different tokens on L2 which both map to the same L1 token.
  • Fixes the timing issue where we double rebalance via the Bridge API due to the rebalancer run frequency being faster than the time it takes for the Bridge API to update. This is done by checking for a transfer of matching amounts to the deposit address of every transfer which is still in the awaiting_funds state. If a transfer is found, then we can safely assume the transfer is outstanding, so we do not need to send another one. If no transfer is found, then we can assume that we still need to initiate another rebalance.

Signed-off-by: bennett <bennett@umaproject.org>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eee8d8f911

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/bridges/BridgeApi.ts Outdated
Signed-off-by: bennett <bennett@umaproject.org>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7437455260

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/bridges/BridgeApi.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7437455260

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/bridges/BridgeApi.ts Outdated
bmzig added 2 commits March 26, 2026 15:23
* feat: define an L1 token splitter bridge

Signed-off-by: bennett <bennett@umaproject.org>

* feat: add l2 token splitter bridge

Signed-off-by: bennett <bennett@umaproject.org>

* use utils

Signed-off-by: bennett <bennett@umaproject.org>

* double

Signed-off-by: bennett <bennett@umaproject.org>

* use upstream functionality

Signed-off-by: bennett <bennett@umaproject.org>

* do extra check on awaiting_funds

Signed-off-by: bennett <bennett@umaproject.org>

---------

Signed-off-by: bennett <bennett@umaproject.org>
@bmzig
Copy link
Copy Markdown
Contributor Author

bmzig commented Mar 26, 2026

@codex review again

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddb6e633d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/bridges/BridgeApi.ts Outdated
@nicholaspai
Copy link
Copy Markdown
Member

@claude

Copy link
Copy Markdown
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

Nice pr

Comment thread src/adapter/bridges/BridgeApi.ts Outdated
Comment thread src/adapter/l2Bridges/BridgeApi.ts
Comment thread src/adapter/l2Bridges/TokenSplitterBridge.ts
bmzig and others added 3 commits March 27, 2026 14:28
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce5e962077

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/bridges/BridgeApi.ts
Comment thread src/utils/BridgeUtils.ts Outdated
bmzig and others added 2 commits March 30, 2026 08:56
Signed-off-by: bennett <bennett@umaproject.org>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 125df738d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/l2Bridges/TokenSplitterBridge.ts
Comment thread src/utils/BridgeUtils.ts Outdated
Signed-off-by: bennett <bennett@umaproject.org>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48799f7ef5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/l2Bridges/TokenSplitterBridge.ts
Comment thread src/utils/BridgeUtils.ts Outdated
Comment thread src/utils/BridgeUtils.ts Outdated
Comment thread src/utils/BridgeUtils.ts Outdated
Copy link
Copy Markdown
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

The filterInitiatedTransfers function is pretty hard to understand can we simplify it?

@bmzig bmzig changed the title improve: do not allow flexible transfer amounts in BridgeApi improve: add l2 token splitter and fix Bridge API transfer tracking Apr 2, 2026
bmzig and others added 3 commits April 2, 2026 16:18
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
@bmzig
Copy link
Copy Markdown
Contributor Author

bmzig commented Apr 2, 2026

@codex

@bmzig bmzig requested a review from nicholaspai April 2, 2026 19:12
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c3fd91eb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/adapter/l2Bridges/TokenSplitterBridge.ts
bmzig and others added 4 commits April 3, 2026 09:01
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Comment thread src/utils/BridgeUtils.ts
@bmzig bmzig requested a review from nicholaspai April 10, 2026 14:58
pxrl
pxrl previously approved these changes Apr 10, 2026
Comment thread src/utils/BridgeUtils.ts Outdated
Comment thread src/utils/BridgeUtils.ts Outdated
Comment thread src/adapter/bridges/BridgeApi.ts
Signed-off-by: bennett <bennett@umaproject.org>
@bmzig bmzig merged commit d2266db into master Apr 10, 2026
4 checks passed
@bmzig bmzig deleted the bz/fixAmount branch April 10, 2026 16:13
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