-
Notifications
You must be signed in to change notification settings - Fork 5
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
GasLimit to 0 #46
GasLimit to 0 #46
Conversation
* channel: Include shared Nonce object, incrementing the nonce of an account while the transaction is broadcast. Implement sync.Mutex, locking the nonce incrementals. In erc20_depositor.go, the depositing process is locked during the "Approve" function call with ```lockKey```. The function ```(d *ERC20Depositor) Deposit``` is renamed to `````(d *ERC20Depositor) DepositOnly` * client: To avoid timeouts caused by the added locking mechanism during ERC20 deposits, ```context.WithTimeout``` and ```twoPartyTestTimeout``` has been increased in fund_test.go and payment_test.go. * client/test: Timeouts have been increased to avoid premature timeout errors due to the locking mechanism above. --------- Signed-off-by: Ilja von Hoessle <ilja@perun.network> Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
Remove unused SharedNonceMtx. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
refactor(erc20_depositor): - Create seperate function for Approval. - Rename lock and mutex. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
- Add description to Approve function. - Put Error as last return element in Approve function. fix(erc20_depositor): - remove unnecessary locking of depositLocksMtx. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
Fix comment and Argument order for Linter. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
so that it is dynamically calculated by the wallet. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
Co-authored-by: Philipp Lehwalder <philipp.lehwalder@gmail.com> Signed-off-by: Sophia <118169531+sophia1ch@users.noreply.github.com> Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
- Change SharedMutex to SharedExpectedNoncesMutex. refactor(erc20_depositor): - Return directly if Approval returns error. - Fix comments. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
Change position of bracket. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
- GasLimit is set when adjudicator and depositors are created. - This way we can differentiate between tests and production. Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
7d8a144
to
89f7b83
Compare
Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
Signed-off-by: Sophia <118169531+sophia1ch@users.noreply.github.com>
Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
Signed-off-by: sophia1ch <sophia.koehler@outlook.com>
channel/funder_test.go
Outdated
// Use an ERC20 depositor with random addresses at index 1. | ||
token := wallettest.NewRandomAddress(rng) | ||
depositors[1] = ethchannel.NewERC20Depositor(ethwallet.AsEthAddr(token)) | ||
depositors[1] = ethchannel.NewERC20Depositor(ethwallet.AsEthAddr(token), 100000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gaslimit value is already defined above as txGasLimit. You can use that value.
In fact, both depositors, the NewETHDepositor and the NewERC20Depositor could use constants defined above: Instead of txGasLimit, you can set txERC20GasLimit and txETHGasLimit for both cases, with 100000 and 50000, respectively.
Signed-off-by: Sophia Koehler <sophia@perun.network>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces the gas limit as a non-constant input parameter for contract calls. Good work!
Description:
This PR sets the GasLimit to a given argument in the ERC20_Depositor, ETH_Depositor and ContractBackend. This allows us to set the gas limit to 0 for all chains that support the dynamic gasLimit estimation.