celo-org / celo-blockchain

Official repository for the golang Celo Blockchain
https://celo.org
GNU Lesser General Public License v3.0
560 stars 198 forks source link

Fee currencies without `credit`/`debit` #2199

Closed palango closed 10 months ago

palango commented 11 months ago

Description

Prototype for gas currency payments without credit/debit functions in the token contract.

Inside the EVM state transition code it is possible to send transactions from arbitrary accounts. @karlb came up with the idea to use this to use the existing approve/transferFrom functions to remove the need of credit/debit functions in fee currency token contracts.

During the implementation it became clear that it is possible to just call transfer, which reduces the overhead further.

There's two remaining differences from the current implementation:

⚠️ The code is a prototype, the gas limit handling is just wrong and error handling needs to be improved.

github-actions[bot] commented 11 months ago

5867 passed, 5 failed, 45 skipped

Test failures:
  TestTransferERC20: e2e_test
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000
Checking gas price minimum. cusdValue = 100000000
e2e_transfer_test.go:472: 
  TestRPCDynamicTxGasPriceWithoutStateForAlternativeCurrencyBeforeGingerbread: e2e_test
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000 
Checking gas price minimum. cusdValue = 100000000
    e2e_test.go:607: 
  TestRPCDynamicTxGasPriceWithoutStateForAlternativeCurrencyAfterGingerbread: e2e_test
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000 
Checking gas price minimum. cusdValue = 100000000
    e2e_test.go:607: 
  TestEthersJSCompatibilityDisableAfterGingerbread: e2e_test
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000 
Checking gas price minimum. cusdValue = 100000000
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000 
Checking gas price minimum. cusdValue = 100000000
    e2e_test.go:742: 
    e2e_test.go:744: 
  TestEthersJSCompatibilityDisableBeforeGingerbread: e2e_test
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000 
Checking gas price minimum. cusdValue = 100000000
    e2e_test.go:770: 
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000 
Checking gas price minimum. cusdValue = 100000000
This test report was produced by the test-summary action.  Made with ❤️ in Cambridge.
palango commented 10 months ago

Closing, as this will be Cel2 only.