EOSIO / eosio.cdt

EOSIO.CDT (Contract Development Toolkit) is a suite of tools used to build EOSIO contracts
http://eosio.github.io/eosio.cdt
MIT License
512 stars 289 forks source link

Compiling smart contract not getting done #1090

Open varshadqz opened 3 years ago

varshadqz commented 3 years ago

I have a setup of multi-node of 4 peers blockchain. Blockchain is running, few days before I deployed the smart contract and using it to save data on the blockchain. Now, I did some changes to the smart contract by changing the multi-index table name. Trying to compile and deploy this smart contract again. On the local machine, it gets compiled successfully. But on the server-side, the compilation is not getting finished with no error. It looks stuck (blinking cursor). What may be the reason? Let me know if anybody needs more information. Compilation command:

eosio-cpp --abigen commoncontract.cpp -o commoncontract.wasm

And

EOSIO.CDT 1.6.3

Smart contracts are in hpp files saved in /usr/opt/eosio.cdt/1.6.3/include/contracts/ and included in smart contract as header files. Smart contract is:

#include "contracts/group.hpp"
#include "contracts/user.hpp"
#include "contracts/document.hpp"

extern "C" {

        [[eosio::wasm_entry]]
                void apply(uint64_t receiver, uint64_t code, uint64_t action) {
                        if (code == receiver) {
                                switch (action) {
                                        EOSIO_DISPATCH_HELPER(group, (upsertgroup)(erasegroup))
                                        EOSIO_DISPATCH_HELPER(user, (upsertuser)(eraseuser))
                                        EOSIO_DISPATCH_HELPER(document, (upsertdoc)(erasedoc))
                                }
                        }
                }
}

Also when I tried multiple times, temporary wasm files get generated like commoncontract.wasm.tmp3f5048b. Please help.

sanaraufx commented 3 years ago

Can you please share the OS version, memory size, and # of cores?

varshadqz commented 3 years ago

OS: Ubuntu 18.04, Memory : 7.79 GiB, CPU Cores : 2

guilledk commented 3 years ago

I've been having a similar error manifesting on github workflow runs, I'm developing a python pytest plugin and have CI setup, but when adding non trivial smart contracts, eosio-cpp just hangs.

Locally everything runs fine.

Here is a recent run: https://github.com/guilledk/pytest-eosiocdt/runs/2551125202?check_suite_focus=true For more examples, check any actions run with over 6hs in run time: https://github.com/vapaee/vapaee-smart-contracts/actions