modify rate limit behavior on incoming funds#16
Merged
Conversation
andygolay
requested changes
Dec 16, 2025
Collaborator
There was a problem hiding this comment.
@Primata the change makes sense and appears to fit option 2 in the Slack discussion. New tests appear to be valid.
A couple thing to fix:
- On main all tests pass with
movement move test --dev
on this PR's branch we get the following failure:
Test failures:
Failures in 0x302814823::oft_using_move_oft_adapter_tests:
┌── test_send_rate_limit_netted_by_receive ──────
│ error[E11001]: test failure
│ ┌─ /Users/andygmove/Downloads/repos/layerzero-devtools/examples/oft-evm-move-adapters/sources/shared_oft/oft_impl_config.move:301:9
│ │
│ 294 │ public(friend) fun try_consume_rate_limit_capacity_at_time(
│ │ --------------------------------------- In this function in 0x302814823::oft_impl_config
│ ·
│ 301 │ assert!(rate_limit.in_flight_on_last_update + amount <= rate_limit.limit, EEXCEEDED_RATE_LIMIT);
│ │ ^^^^^^ Test was not expected to error, but it aborted with code 4 originating in the module 0000000000000000000000000000000000000000000000000000000302814823::oft_impl_config rooted here
│
│
│ stack trace
│ oft_impl_config::try_consume_rate_limit_capacity(/Users/andygmove/Downloads/repos/layerzero-devtools/examples/oft-evm-move-adapters/sources/shared_oft/oft_impl_config.move:290)
│ move_oft_adapter::debit_fungible_asset(/Users/andygmove/Downloads/repos/layerzero-devtools/examples/oft-evm-move-adapters/sources/oft_implementation/move_oft_adapter.move:103)
│ oft::send_internal(/Users/andygmove/Downloads/repos/layerzero-devtools/examples/oft-evm-move-adapters/sources/shared_oft/oft.move:117)
│ oft::send_withdraw(/Users/andygmove/Downloads/repos/layerzero-devtools/examples/oft-evm-move-adapters/sources/shared_oft/oft.move:86-89)
│ oft_using_move_oft_adapter_tests::test_send_rate_limit_netted_by_receive(/Users/andygmove/Downloads/repos/layerzero-devtools/examples/oft-evm-move-adapters/tests/oft_using_move_oft_adapter_tests.move:320)
│
└──────────────────
Test result: FAILED. Total tests: 66; passed: 65; failed: 1
{
"Error": "Move unit tests failed"
}
Please ensure all tests pass and logic is correct.
- Clean up this Move warning:
warning: Unused value of parameter `src_eid`. Consider removing the parameter, or prefixing with an underscore (e.g., `_src_eid`), or binding to `_`
┌─ /Users/andygmove/Downloads/repos/layerzero-devtools/examples/oft-evm-move-adapters/sources/oft_implementation/move_oft_adapter.move:56:9
│
56 │ src_eid: u32,
│ ^^^^^^^
Thanks!
apenzk
suggested changes
Dec 16, 2025
apenzk
left a comment
There was a problem hiding this comment.
if the changes match the propossal option 2 in PR 126, reference the PR to give context
Collaborator
Author
Oh okay, seems like we need to change previous tests, on it. |
rubujubi
approved these changes
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goals:
Changes behavior on incoming funds by removing release_rate_limit_capacity and adding try_consume_rate_limit_capacity on the Movement endpoint.