eos icon indicating copy to clipboard operation
eos copied to clipboard

Docker build for 1.3.0 doesn't override SYS symbol.

Open ajose01 opened this issue 8 years ago • 5 comments

Attempted to pass in as flag argument and by overriding in file directly. Built using --no-cache but eosio.system contract still won't deploy w/o SYS token being issued.

Dockerfile diff:

dev@eos:~/eos/Docker$ git diff Dockerfile
diff --git a/Docker/Dockerfile b/Docker/Dockerfile
index 24dd447..7b5d786 100644
--- a/Docker/Dockerfile
+++ b/Docker/Dockerfile
@@ -1,6 +1,6 @@
 FROM eosio/builder as builder
 ARG branch=master
-ARG symbol=SYS
+ARG symbol=EOS

eosio.system deploy attempt w/ EOS:

➜  build git:(08819aae0) ✗ cleos set contract eosio contracts/eosio.system
Reading WASM from contracts/eosio.system/eosio.system.wasm...
Publishing contract...
Error 3050003: eosio_assert_message assertion failure
➜  build git:(08819aae0) ✗ cleos get account eosio
privileged: true
permissions:
     owner     1:    1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
        active     1:    1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
memory:
     quota:       unlimited  used:     2.895 KiB

net bandwidth:
     used:               unlimited
     available:          unlimited
     limit:              unlimited

cpu bandwidth:
     used:               unlimited
     available:          unlimited
     limit:              unlimited

EOS balances:
     liquid:    10000000000.0000 EOS
     staked:            0.0000 SYS
     unstaking:         0.0000 SYS
     total:     Error 3010011: Invalid asset
Error Details:
addition between two different asset is not allowed

After creating SYS and redeploying eosio.system:

➜  build git:(08819aae0) ✗ cleos set contract eosio contracts/eosio.system
Reading WASM from contracts/eosio.system/eosio.system.wasm...
Publishing contract...
executed transaction: 044766e4c4a86872f9bdc45f7f83f15f3034cd720751ec49e3c15f470bbfbe2f  36768 bytes  6521 us
#         eosio <= eosio::setcode               {"account":"eosio","vmtype":0,"vmversion":0,"code":"0061736d0100000001b0022e60037f7e7e0060017f006002...
#         eosio <= eosio::setabi                {"account":"eosio","abi":"0e656f73696f3a3a6162692f312e30050c6163636f756e745f6e616d65046e616d650f7065...
warning: transaction executed locally, but may not be confirmed by the network yet    ]
➜  build git:(08819aae0) ✗ cleos get account eosio
privileged: true
permissions:
     owner     1:    1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
        active     1:    1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
memory:
     quota:       unlimited  used:     1.116 MiB

net bandwidth:
     used:               unlimited
     available:          unlimited
     limit:              unlimited

cpu bandwidth:
     used:               unlimited
     available:          unlimited
     limit:              unlimited

SYS balances:
     liquid:    10000000000.0000 SYS
     staked:            0.0000 SYS
     unstaking:         0.0000 SYS
     total:     10000000000.0000 SYS

ajose01 avatar Sep 21 '18 05:09 ajose01

Did you create the EOS token? I have not been able to reproduce. I simply built an image using docker build -t symbol-test --build-arg symbol=EOS ., started up the container and nodeos, and then did the following:

root@211d0b053fdd:/# cleos wallet create --to-console
"/opt/eosio/bin/keosd" launched
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5KLX5aGLvJt7cupV3h7LRouhScTyHFQfLY5ieaZw2QgoHFkBWA8"
root@211d0b053fdd:/# cleos wallet import
private key: imported private key for: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
root@211d0b053fdd:/# cleos wallet list
Wallets:
[
  "default *"
]
root@211d0b053fdd:/# cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
executed transaction: c64a8f24bb3db94afe24c6a245c627e6f7e6bf0a4b542fbbb0051a5f962d07eb  200 bytes  183 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"eosio.token","owner":{"threshold":1,"keys":[{"key":"EOS6MRyAjQq8ud7hVNYcf...
warning: transaction executed locally, but may not be confirmed by the network yet    ]
root@211d0b053fdd:/# cleos set contract eosio.token /contracts/eosio.token
Reading WASM from /contracts/eosio.token/eosio.token.wasm...
Publishing contract...
executed transaction: 3c8dcb0a9341a98228c6842d0b12c5fb0457015ccf004f1ae10e40d6c0537723  8104 bytes  853 us
#         eosio <= eosio::setcode               {"account":"eosio.token","vmtype":0,"vmversion":0,"code":"0061736d01000000017e1560037f7e7f0060057f7e...
#         eosio <= eosio::setabi                {"account":"eosio.token","abi":"0e656f73696f3a3a6162692f312e30010c6163636f756e745f6e616d65046e616d65...
warning: transaction executed locally, but may not be confirmed by the network yet    ]
root@211d0b053fdd:/# cleos push action eosio.token create '["eosio", "10000000000.0000 EOS"]' -p eosio.token
executed transaction: b657aed1601ad7564d3dd440c0757243ba2ed1f1f83138e58ea05ba64e21f53f  120 bytes  271 us
#   eosio.token <= eosio.token::create          {"issuer":"eosio","maximum_supply":"10000000000.0000 EOS"}
warning: transaction executed locally, but may not be confirmed by the network yet    ]
root@211d0b053fdd:/# cleos set contract eosio /contracts/eosio.system
Reading WASM from /contracts/eosio.system/eosio.system.wasm...
Publishing contract...
executed transaction: 83bcedf96c898af48acd6d07f8fb7e57884ad429f066c0e1cc0be4b16ee538cd  36768 bytes  3253 us
#         eosio <= eosio::setcode               {"account":"eosio","vmtype":0,"vmversion":0,"code":"0061736d0100000001b0022e60037f7e7e0060017f006002...
#         eosio <= eosio::setabi                {"account":"eosio","abi":"0e656f73696f3a3a6162692f312e30050c6163636f756e745f6e616d65046e616d650f7065...
warning: transaction executed locally, but may not be confirmed by the network yet    ]
root@211d0b053fdd:/# cleos push action eosio.token issue '["eosio", "1000000000.0000 EOS", ""]' -p eosio
executed transaction: 1370282a9a5fd3e8379e9c55caa6552d3e63ef23af6e2c2529ed074d7d8c16e8  120 bytes  371 us
#   eosio.token <= eosio.token::issue           {"to":"eosio","quantity":"1000000000.0000 EOS","memo":""}
warning: transaction executed locally, but may not be confirmed by the network yet    ]
root@211d0b053fdd:/# cleos get account eosio
created: 2018-06-01T12:00:00.000
privileged: true
permissions:
     owner     1:    1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
        active     1:    1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
memory:
     quota:       unlimited  used:     1.116 MiB

net bandwidth:
     used:               unlimited
     available:          unlimited
     limit:              unlimited

cpu bandwidth:
     used:               unlimited
     available:          unlimited
     limit:              unlimited

EOS balances:
     liquid:    1000000000.0000 EOS
     staked:            0.0000 EOS
     unstaking:         0.0000 EOS
     total:     1000000000.0000 EOS


root@211d0b053fdd:/#

ericiles avatar Sep 24 '18 17:09 ericiles

I will try again. But yes as you can see from the initial get account eosio there are EOS issued.

ajose01 avatar Sep 24 '18 17:09 ajose01

@ajose01:

The first response to get account is indicative of a deployed system contract that was built with SYS as the core symbol, even though the nodeos API node it gets the response from is built with EOS as the core symbol.

How did you compile the eosio.system.wasm that you deploy to the blockchain using cleos? Can you verify that the generated eosiolib/core_symbol.hpp has defined CORE_SYMBOL as S(4,EOS)? Perhaps an old version of it that sets it to S(4,SYS) has stuck around in the build.

arhag avatar Sep 24 '18 17:09 arhag

get account will only query the multi_index tables from the states, but it doesn't directly communicate with any smart contract. I think @ericiles has already pointed out the solution. much thanks!

taokayan avatar Sep 27 '18 03:09 taokayan

OBE. The system contract no longer has a hardcoded core symbol as of release v1.4.0 of eosio.contracts. It now has an init action to specify it.

jgiszczak avatar Nov 19 '18 22:11 jgiszczak