fix(bmr): send only one receipt per transaction#545
fix(bmr): send only one receipt per transaction#545MuhammedIrfan wants to merge 15 commits intomainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #545 +/- ##
============================================
+ Coverage 42.01% 42.51% +0.49%
Complexity 801 801
============================================
Files 115 116 +1
Lines 11321 11317 -4
Branches 941 941
============================================
+ Hits 4757 4811 +54
+ Misses 6155 6093 -62
- Partials 409 413 +4
|
|
Hi @MuhammedIrfan, |
|
These changes need tests. |
Thanks @CyrusVorwald-ICON for pointing it out. It wasn't a final solution, but rather an intermediate one to see if it works for NEAR. Anyway, I'll refactor the shared code for segmentation used across all chains and add necessary test and push again. |
…paid-gas-error' of github.com:icon-project/icon-bridge into fix/543-bmc-transaction-failing-due-to-exceeded-the-prepaid-gas-error
|
Hi @MuhammedIrfan, The tests that were failing on near side were not implemented correctly. I've changed the test parameters so that they work as expected. They should work now. |
Btw, have you deployed this code? Let's test it on local and see if it resolves the original issue that this PR resolves. If it does, I'll approve the changes and merge into main. |
|
@bbist looks like it does not add message to tx if rlp size is more than configured limit also if it have only 1 event |
Yeah. That's true. You can configure a limit that can handle 1 event. We did the same for BSC. |
But we can't always be sure of size right, at times when the event size is more than configured it create relay message without any receipts eg: https://explorer.testnet.near.org/transactions/3or4kyeL7fQ6uds73BfCynMbHscnBG4tLjwCHNA4EJon |
…ded-the-prepaid-gas-error
…ded-the-prepaid-gas-error
What is the maximum number of events the NEAR chain can handle in a single transaction? Is it a single event of can it handle 2-3 or more? If so, you can chose some data size limit that can cover 2 or more events. And in the worst case, it'll forward 1 event. This is what we did for BSC. |
This is not happening, I have updated the test to test this scenario. Please check.
At present NEAR supports only one event which is being improved as part of gas optimization, As different BTP Messages have different gas usage, for example, Init BTP Message will use less than that transfer, and Link BTP Message uses more gas, Until we find a way to optimize and segment the message in the relay we might just keep only 1 BTP Message per Relay Message |
Well, in that case as a temporary solution, let's have a minimum number of events set to 1 while segmenting for NEAR. |
@MuhammedIrfan, |
| Message *chain.Message | ||
| Options types.SenderOptions | ||
| }{ | ||
| PrivateKey: "22yx6AjQgG1jGuAmPuEwLnVKFnuq5LU23dbU3JBZodKxrJ8dmmqpDZKtRSfiU4F8UQmv1RiZSrjWhQMQC3ye7M1J", |
There was a problem hiding this comment.
It would be good to generate a random one instead predefined for private key
Closes #543
Closes #186
Checklist: