mx-chain-go
mx-chain-go copied to clipboard
Feat/RelayedV3
Reasoning behind the pull request
- Relayed tx v3
- Fix base cost of user tx for all relayed transactions
- Only consume move balance cost of user tx in case of relayed move balance
Proposed changes
- Implemented relayed tx v3. Added a new field on the tx, InnerTransactions that can hold a configurable max number of relayed user transactions (currently set to 50 max).
- Fixed base cost of relayed tx for all types. Ex: let's consider a relayed v1 tx, with a move balance as user tx, having len of data 200. Considering we would have passed the fixed gas limit, it should be: 50.000 for user move balance + 50.000 for relayed tx + 300.000 for len of data. So total of 400.000. But, due to the way it was computed, it would have cost less than that (350.000 for relayed tx + 500 considered the processing cost). After this fix, this tx should consume exactly 400.000. Also applies for sc calls, where the base cost was omitted.
- Now when a move balance is detected as a user tx, only the cost of move balance is removed from relayer, no matter how much extra gas is provided.
Testing procedure
- standard system test
- test relayed v1 and relayed v2 fees for all kind of transactions(failure/refund scenarios to be verified as well). Make sure the fees consumed by the same transaction are different before and after the fix. After fix, all of them should consume more gas as described above.
- test relayed v3 transaction execution + fees consumed + events generated for all user txs, in respect with the confluence specs
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
- was the PR targeted to the correct branch?
- if this is a larger feature that probably needs more than one PR, is there a
featbranch created? - if this is a
featbranch merging, do all satellite projects have a proper tag insidego.mod?
Codecov Report
Attention: Patch coverage is 74.23581% with 59 lines in your changes are missing coverage. Please review.
Project coverage is 78.77%. Comparing base (
6d93fee) to head (d31d68b). Report is 1 commits behind head on rc/v1.7.next1.
Additional details and impacted files
@@ Coverage Diff @@
## rc/v1.7.next1 #5741 +/- ##
=================================================
- Coverage 78.80% 78.77% -0.03%
=================================================
Files 752 752
Lines 98013 98137 +124
=================================================
+ Hits 77238 77308 +70
- Misses 15553 15604 +51
- Partials 5222 5225 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.