Coder Social home page Coder Social logo

everx-labs / evernode-se Goto Github PK

View Code? Open in Web Editor NEW
51.0 8.0 27.0 11.13 MB

Local Node for DApp development and testing in TVM blockchains (Everscale, TON, Venom, etc)

Home Page: https://docs.evercloud.dev/products/simple-emulator-se

License: Apache License 2.0

Dockerfile 1.62% Shell 2.06% JavaScript 11.74% Rust 71.61% Batchfile 0.29% Solidity 9.02% HTML 2.46% CSS 0.28% Procfile 0.04% D 0.88%
local blockchain node everscale toncoin solidity testing testing-tools ton venom

evernode-se's People

Contributors

a-zorina avatar alex-novikov-1990 avatar alexeyvavilin avatar atomxy avatar bvscd avatar d3p avatar elasticlove1 avatar fairyfromalfeya avatar igorkoval avatar ilyar avatar joydark avatar melsomino avatar sumrachek avatar tonjen avatar yaroslavser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evernode-se's Issues

[Windows] Subscribe for transactions with addresses (ABIv1) test failed

Steps to reproduce:

Result:

PS>$env:USE_NODE_SE="true";$env:TON_NETWORK_ADDRESS="http://localhost:8080";node run
1.11.0
✓ Test versions compatibility (1 / 0)
✓ crypto (2 / 0)
✓ encode_message (3 / 0)
✓ net (4 / 0)
✓ Block signatures (5 / 0)
✓ All Accounts (6 / 0)
✓ Ranges (7 / 0)
✓ Wait For (8 / 0)
𐄂 Subscribe for transactions with addresses (ABIv1) (8 / 1) - [
    {
        "matcherResult": {
            "pass": false
        },
        "message": "\u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).\u001b[22mtoBeGreaterThan\u001b[2m(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m)\u001b[22m\n\nExpected: > \u001b[32m0\u001b[39m\nReceived:   \u001b[31m0\u001b[39m"
    }
]
✓ Subscribe for transactions with addresses (ABIv2) (9 / 1)
✓ Subscribe for messages (ABI v1) (10 / 1)
✓ Subscribe for messages (ABI v2) (11 / 1)
✓ Transactions with addresses (12 / 1)
✓ Check shard_hashes greater then 0 (13 / 1)
---
success: 13
failure: 1

PS: I've open PR with a workaround for tests everx-labs/ever-sdk-js#206

The results of calling `selfdestruct` function in EvernodeSE and Devnet differ.

Problem

We need to destruct the contact and transfer its tokens to some destination account.

Version

tonlabs/local-node:0.35.0

Expected behaviour

  • Desctructed contract has zero balance and "non exists" type.
  • Account destination has positive balance

Resulting behaviour

  • in Devnet
    • as expected
  • in Evernode SE
    • Desctructed contract is not destructed, its balance unchanged, but transfer to destination account exists!
    • Account destination has positive balance!

How to reproduce a bug

To reproduce this bug clone https://github.com/Artem-Zhdanov/evernode-se-selfdestruct-bug

everdev se start

Intall dependencies and run

npm i
node selfdestruct.js

Open http://localhost and finds accounts in the output

Time synchronization issue after some time of continuous load

I've been running a test which works with localnode. It generates lots of messages while pushing to GOSH, deployed on the localnode. At first it works well, but after a couple of hours localnode seems to lose time synchronization:

2023-06-08T19:58:58.048555Z TRACE ThreadId(03) git-remote-helper:run:push:push_ref:push_commit_object:push_new_blob:push:tokio::spawn::push_diff:push_diff:inner_push_diff:deploy_diff:send_message:blockchain_client::send_message: callback: 
SendFailed: {
    shard_block_id: "0470a4d6fcc37b88a30f7386cc246efc71edaf303cd45e93b6981bae96f16269",
    message_id: "7cd39d44257ae092d9d675dc4cd2a4e0a82c08cd32c712fb08734e116abef773"
    error: "Send message failed: The time on the device is out of sync with the time on the server. Synchronize your device time with internet time"
}
ClientError {
    code: 606,
    message: "The time on the device is out of sync with the time on the server. Synchronize your device time with internet time",
    data: Object {
        "delta_ms": Number(227369),
        "threshold_ms": Number(15000),
        "config_servers": Array [
            String("localhost/"),
        ],
        "endpoint": String("http://localhost/graphql"),
    },

Memory leak in node

Description:

The node has a memory leak. Memory fills even in an idle state. After that, it crashes and restarts

Screenshot 2022-11-29 at 19 20 32

Why honcho in particular?

  1. Why is honcho in particular used here?

  2. What's the neccessity? Why not run all of them without honcho, as ordinary processes? Is it specific to the fact that it's all done in Docker?

How are the config files generated?

How are the initial config files of a SE node generated? By what? What's the algorightm? How do I generate or re-generate them on my own?

Unobvious operation of these states when updating a smart contract.

There are two of the easiest smart contracts firstContract and secondContract.
Deploy 'firstContract' smart contract and calling external method contract "setValue", set value a,b=12.
Data state contract: m_value = 24, version = 1. Calling 'updateContractCode' and set code from 'secondContract'. After update smart contract check values version=2 but m_value=0.
Waiting that m_value=24,, because tvm.resetStorage don't calling.
This is inappropriate behavior on upgraded data states to default value.

firstContract code:
`pragma ton-solidity >= 0.57.0;

pragma AbiHeader time;
pragma AbiHeader expire;
pragma AbiHeader pubkey;

contract firstContract {

uint32 nonce_;
uint public m_version = 1;
uint public m_value;

address owner;

constructor(address owner_ ) public {
	tvm.accept();
	owner = owner_;
}

modifier checkOwnerAndAccept {
	require(msg.sender == owner, 120);
	tvm.accept();
	_;
}

function setValue(uint a, uint b) external {
	tvm.rawReserve(1 ton, 0);
	m_value = a + b; 
}

function getOwner() external view responsible returns (address) {
	return {value: 0, flag: 64, bounce: false} owner;

}

function updateContractCode(TvmCell newcode) public view checkOwnerAndAccept {
	tvm.setcode(newcode);
	tvm.setCurrentCode(newcode);
	
	TvmCell stateVars = abi.encode(m_version);
    onCodeUpgrade(stateVars);
}

function onCodeUpgrade(TvmCell stateVars) private pure {}

}`

secondContract code:
`pragma ton-solidity >= 0.57.0;

pragma AbiHeader time;
pragma AbiHeader expire;
pragma AbiHeader pubkey;

contract secondContract {

uint32 nonce_;
uint public m_version; 
uint public m_value;

address owner;

modifier checkOwnerAndAccept {
	require(msg.sender == owner, 110);
	tvm.accept();
	_;
}

function setValue(uint a, uint b) external {
	tvm.rawReserve(1 ton, 0);
	m_value = a + b; 
}

function getOwner() external view responsible returns (address) {
	return {value: 0, flag: 64, bounce: false} owner;

}

function updateContractCode(TvmCell newcode) public checkOwnerAndAccept {
	tvm.setcode(newcode);
	tvm.setCurrentCode(newcode);
	TvmCell stateVars = abi.encode(m_version);

	onCodeUpgrade(stateVars);
}

function onCodeUpgrade(TvmCell stateVars) private {
	(uint version) = abi.decode(stateVars, (uint));
	m_version = version + 1;
}

}`

Build failed. aes-ctr crate is DEPRECATED

root@13485a15bdb7:/tonos-se/ton-node-se# cargo build --release
Updating crates.io index
Updating git repository https://github.com/tonlabs/ton-labs-block.git
Updating git repository https://github.com/tonlabs/ton-labs-block-json.git
Updating git repository https://github.com/tonlabs/ton-labs-executor.git
Updating git repository https://github.com/tonlabs/ton-labs-types.git
Updating git repository https://github.com/tonlabs/ton-labs-vm.git
Updating git repository https://github.com/tonlabs/ton-labs-tl.git
Updating git repository https://github.com/tonlabs/ton-labs-assembler.git
Updating git repository https://github.com/paritytech/rust-secp256k1
Updating git repository https://github.com/tonlabs/TON-SDK.git
Updating git repository https://github.com/tonlabs/lockfree.git
error: failed to select a version for the requirement stream-cipher = "^0.3"
candidate versions found which didn't match: 0.99.99, 0.7.1, 0.6.0, ...
location searched: crates.io index
required by package aes-ctr v0.3.0
... which is depended on by adnl v0.0.4 (/tonos-se/ton-node-se/adnl)
... which is depended on by ton_node_startup v0.28.4 (/tonos-se/ton-node-se/ton_node_startup)

Unable to start se

I tried to start SE with the command tondev se start but it didn't work: tondev se info shows that the default instance has state "exited".
Also I tried docker run -e USER_AGREEMENT=yes -p80:80 tonlabs/local-node and the container exited with the following output:

16:08:57 system | node_workers.1 started (pid=14)
16:08:57 node_workers.1 | + set -e
16:08:57 node_workers.1 | + cd /ton-node
16:08:57 node_workers.1 | + exec /node/ton-node --config ./ton-node.conf.json --blockchain-config ./blockchain.conf.json
16:08:57 system | arango.1 started (pid=12)
16:08:57 arango.1 | + set -e
16:08:57 arango.1 | + ARANGO_INIT_PORT=8529
16:08:57 arango.1 | + ARANGO_ENDPOINT=tcp://127.0.0.1:8529
16:08:57 arango.1 | + ARANGO_INIT_PIDFILE=/run/arango-init.pid
16:08:57 arango.1 | + export GLIBCXX_FORCE_NEW=1
16:08:57 arango.1 | + GLIBCXX_FORCE_NEW=1
16:08:57 arango.1 | + NUMACTL=
16:08:57 arango.1 | + '[' -d /sys/devices/system/node/node1 -a -f /proc/self/numa_maps ']'
16:08:57 arango.1 | + arangod --config /arango/config --server.endpoint tcp://127.0.0.1:8529 --server.authentication=false --log.foreground-tty true --database.auto-upgrade true
16:08:57 system | nginx.1 started (pid=13)
16:08:57 system | q_server.1 started (pid=11)
16:08:57 q_server.1 | + set -e
16:08:57 q_server.1 | + export 'Q_DATA_MUT=http://127.0.0.1:8529'
16:08:57 q_server.1 | + export 'Q_DATA_HOT=http://127.0.0.1:8529'
16:08:57 q_server.1 | + export 'Q_SLOW_QUERIES_MUT=http://127.0.0.1:8529'
16:08:57 q_server.1 | + export 'Q_SLOW_QUERIES_HOT=http://127.0.0.1:8529'
16:08:57 q_server.1 | + export 'Q_REQUESTS_MODE=rest'
16:08:57 q_server.1 | + export 'Q_REQUESTS_SERVER=http://127.0.0.1'
16:08:57 q_server.1 | + export 'Q_HOST=127.0.0.1'
16:08:57 q_server.1 | + export 'Q_PORT=4000'
16:08:57 q_server.1 | + cd /home/node/ton-q-server
16:08:57 q_server.1 | + exec node index.js
16:08:57 arango.1 | /arango/entrypoint: line 34: 20 Illegal instruction (core dumped) $NUMACTL arangod --config /arango/config --server.endpoint $ARANGO_ENDPOINT --server.authentication=false --log.foreground-tty true --database.auto-upgrade true
16:08:57 arango.1 | + exit 1
16:08:57 system | arango.1 stopped (rc=1)
16:08:57 system | sending SIGTERM to q_server.1 (pid 11)
16:08:57 system | sending SIGTERM to nginx.1 (pid 13)
16:08:57 system | sending SIGTERM to node_workers.1 (pid 14)
16:08:57 system | node_workers.1 stopped (rc=-15)
16:08:57 system | q_server.1 stopped (rc=-15)
16:08:57 system | nginx.1 stopped (rc=0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.