-
Notifications
You must be signed in to change notification settings - Fork 34
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
Arithmetic underflow/overflow when calling relayMessages()
#15
Comments
Hi @Lohann Thank you for taking a look into this. Let me know if you need more details or code examples. There is also another thing I would like to ask about. In usual tests we use EDIT: |
Hi @Nlferu, thank you for reporting this issue, will investigate. Are you using the examples from this repo? is there a easy way to reproduce this issue? |
I see, if you can provide some setup or way to reproduce the issue will be a great help, also make sure you are using the latest forge command line tool version, we found some issues in previous versions. |
You can clone my repo: https://github.com/Nlferu/analog-cross-chain. Now to reproduce FROM: /// @dev TO BE FIXED AS 'REPLAY' CANNOT BE CALLED TWICE
// Simulate this behavior by calling `GmpTestTools.relayMessages()`, this will relay all pending messages.
// vm.expectEmit(true, true, true, true, address(source));
// emit SourceNFT.InboundOwnershipChange(newMsgID, USER, DEVIL, dest_tokens);
// GmpTestTools.relayMessages(); TO: /// @dev TO BE FIXED AS 'REPLAY' CANNOT BE CALLED TWICE
// Simulate this behavior by calling `GmpTestTools.relayMessages()`, this will relay all pending messages.
vm.expectEmit(true, true, true, true, address(source));
emit SourceNFT.InboundOwnershipChange(newMsgID, USER, DEVIL, dest_tokens);
GmpTestTools.relayMessages(); Now just run this test with: To reproduce 2nd error just go into /// @dev We need to end `setUp` with main network ([0]) in networks array
GmpTestTools.switchNetwork(SEPOLIA_NETWORK, OWNER); Then simply run Let me know in case you would need anything else |
Hi Team,
I have recently encounter below error:
← [Revert] panic: arithmetic underflow or overflow (0x11)
. I figured out that it is caused by callingGmpTestTools.relayMessages();
second time in same test.What exactly I did to get this error?
GmpTestTools.relayMessages();
to actually perform sent messages from source to dest chainGmpTestTools.relayMessages();
second time in same test to trigger proper function on source chain this timeArithmetic underflow/overflow
errortest_teleportTokensBackward
and I just recreated second part of 1st test, so sending tokens from dest to source chain and this test passes without any problemrelayMessage()
function is bugging out while called 2nd time in one go.So my question is, how do I avoid this issue? Do I need to somehow reset relayMessages before calling it 2nd time or do I need to do something else or this is currently unavoidable and only way to test things is to just use Arithmetic underflow/overflow when calling
relayMessages()
function just one time per test function?The text was updated successfully, but these errors were encountered: