Skip to content
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

OutOfGas for flipper contract #2

Closed
kirillt opened this issue Feb 12, 2020 · 3 comments
Closed

OutOfGas for flipper contract #2

kirillt opened this issue Feb 12, 2020 · 3 comments

Comments

@kirillt
Copy link

kirillt commented Feb 12, 2020

Can't instantiate flipper contract. Receiving OutOfGas even when I provide maximum value of gas (4294967295).

This is exempt from debug log with couple of debug prints:

2020-02-12 18:47:48.003 tokio-blocking-driver DEBUG runtime  Balance: 100000001000000, endowment: 10000000000000, fee: 0
2020-02-12 18:47:48.003 tokio-blocking-driver DEBUG runtime  OutOfGasDebug("record_transaction/2")
2020-02-12 18:47:48.003 tokio-blocking-driver DEBUG runtime  DispatchError
2020-02-12 18:47:48.003 tokio-blocking-driver DEBUG runtime  9
2020-02-12 18:47:48.003 tokio-blocking-driver DEBUG runtime  5
2020-02-12 18:47:48.003 tokio-blocking-driver DEBUG runtime  ExitReasonFailed

How to reproduce:
I use this binary compiled with Remix from "flipper" contract":

608060405234801561001057600080fd5b5060008060006101000a81548160ff02191690831515021790555060d5806100396000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80636d4ce63c146037578063cde4efa9146057575b600080fd5b603d605f565b604051808215151515815260200191505060405180910390f35b605d6075565b005b60008060009054906101000a900460ff16905090565b6000809054906101000a900460ff16156000806101000a81548160ff02191690831515021790555056fea264697066735822122053f9ef1a2344b96cd5e209c0a160bde2246caa0d498d14f881690afc84b8272264736f6c63430006010033

The source code:

contract flipper {
    bool private value;

    constructor() public {
        value = false;
    }   

    function flip() public {
        value = !value;
    }   

    function get() public view returns (bool) {
        return value;
    }   
}
@kirillt
Copy link
Author

kirillt commented Feb 12, 2020

I use node-template in this branch of Substrate to test EVM:
https://github.com/paritytech/substrate/commits/evm-enabled

I use my small toolset for testing:
https://github.com/kirillt/substrate-cli-tools
It is under active development, but calls to EVM module should be correct.

This is a testcase:

export U32_MAX="4294967295"
rpc-evm deposit -a 100DEV
rpc-evm create -e 10DEV -p 1 -g $U32_MAX -f data/evm-flipper.evm

@kirillt
Copy link
Author

kirillt commented Feb 12, 2020

I added the test to my toolset repo.
If you have yarn and running node-template from branch evm-enabled, then you can run it:

git clone https://github.com/kirillt/substrate-cli-tools.git cli-tools
cd cli-tools/typescript
test/evm/flipper.sh

@kirillt
Copy link
Author

kirillt commented Feb 19, 2020

This appeared to be a bug in my client.

@kirillt kirillt closed this as completed Feb 19, 2020
sorpaas added a commit that referenced this issue Nov 10, 2023
sorpaas added a commit that referenced this issue Nov 10, 2023
* Integrate jsontests to CI

* cargo test -> cargo run

* Run cargo fmt

* Test CI #1

* Test CI #2

* Test CI #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant