ethereumjs / ethereumjs-lib Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] A JavaScript library of core Ethereum functions
[DEPRECATED] A JavaScript library of core Ethereum functions
current way of using describe.skip leads to a report of 74 pending tests, and this severely misrepresents the true handful of missing tests
it's not a VM error so should be moved elsewhere
review utils fromSigned and toUnsigned and replace bignum mod with mod()
replace parseInt with bignum, eg
acctData.code = utils.intToBuffer(parseInt(acctData.code, 16));
We should wait until POC8 is started to do this
... and add to tests repo
a peer reconnects to same peer. A peer should check its UID
getPeers should only send peers wich the recieving peer doesn't konw about
3 are failing and need to be fixed
the bloom filters need tobe checked after a block is ran in runBlock.
current assumption is prog counter is an int and uses utils.bufferToInt. should probably convert to bignum.
eg jumpi2 test sets the pc to larger than int
All "unintended" exceptions (including INVALID and stack underflow and bad jump destination) work like OOG, returning with 0 gas remaining
Key point: accessing a PC outside of the code is an implicit '\x00' with is STOP, not INVALID, so returns []
need to follow up / clarify.
why is gas not consumed?
with gas99 test https://github.com/ethereum/tests/blob/develop/StateTests/stPreCompiledContracts.json#L1274 why does the 99 not get used up? (only 20 is consumed)
eg these are not being checked (even if they're empty):
https://github.com/ethereum/tests/blob/develop/VMTests/vmEnvironmentalInfoTest.json#L138
Did someone add to the tests and forget to add the data?
Cannot find module './jsonData/genesishashestest.json'
Full stack trace, after running:
$ npm test
is:
> [email protected] test /Users/username/eth/ethos/lib/ethereumjs-lib
> ./script/jshint.sh && istanbul test ./node_modules/.bin/_mocha -- --reporter list test/*.js test/**/*.js
module.js:340
throw err;
^
Error: Cannot find module './jsonData/genesishashestest.json'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/username/eth/ethos/lib/ethereumjs-lib/test/block.test.js:8:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/mocha/lib/mocha.js:152:27
at Array.forEach (native)
at Mocha.loadFiles (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/mocha/lib/mocha.js:149:14)
at Mocha.run (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/mocha/lib/mocha.js:305:31)
at Object.<anonymous> (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/mocha/bin/_mocha:327:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at runFn (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/istanbul/lib/command/common/run-with-cover.js:86:16)
at Object.run (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/istanbul/lib/command/common/run-with-cover.js:184:9)
at TestCommand.Command.mix.run (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/istanbul/lib/command/test.js:27:22)
at runCommand (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/istanbul/lib/cli.js:59:19)
at runToCompletion (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/istanbul/lib/cli.js:63:5)
at Object.<anonymous> (/Users/username/eth/ethos/lib/ethereumjs-lib/node_modules/istanbul/lib/cli.js:68:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
getPeers should only send peers that the requesting peer does not know about.
The VMTests have been updated. For every tests where a VM exception is thrown, there will be no post,callcreates,log,out or gas section. Since reverting is done by the state, not by the VM. A detailed updated definition of VM tests can be found here: https://github.com/ethereum/tests/wiki
I'm trying the example code here: https://wanderer.github.io/ethereum/nodejs/code/2014/05/21/using-ethereums-tries-with-node/
First, I got an error saying that [email protected] needed to be installed, which I did. Now I get the error OpenError: IO error: ./.ethereum/state/LOCK: No such file or directory.
at the end of a non-OOG execution, an account is refunded min(GASREFUND, floor(gas_used / 2))
the tests involing blocks need tobe updated on the newGenisi branch
It seems to be a lot of overlap between the to projects. Is this the case? Is one official or not? is one more feature complete etc etc.
Sorry if an issue is not the right way to interact with the project :)
compute RIPEMD160 (CALL to 2), SSTORE, and then retrieve should be 32bytes. Same with ECRECOVER
after progcounter 91 Opcode: ORIGIN
AZ pushes 0x29d33c02a200937995e632c4597b4dca8e503978 on the stack
But JS pushes:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b
It doesn't affect the outcome of the test, but should eventually be looked into.
like so
txLogsBloom(tx):
let B := 0
for each log in [log0, log1, ..., logN]:
let [address, [topic0, topic1, ..., topicN], data] := log
let S := [ sha3(address), sha3(topic0), sha3(topic1), ..., sha3(topicN) ]
for each s in S:
B |= bloom9(s)
return B
logsBloom(b):
let B := bloom9(sha3(coinbase))
for each tx in [tx0, tx1, ..., txN]:
B |= txLogsBloom(tx)
return B
bloom9(s):
R := 0
for i in { 0, 2, 4 }:
R |= 1 << (s[i + 1] + 256 * (s[i] & 1)) // where S[X] is the Xth byte of S
return R
Transactions are INVALID if:
v < 27
v > 28
r >= secp256k1n = 115792089237316195423570985008687907852837564279074904382605163141518161494337
s >= secp256k1p = 2256 - 232 - 977
Also applies to proc ecrecover
[Common]: vmArithmeticTest signextendInvalidByteNumber run code:
Maximum call stack size exceeded
[Common]: vmArithmeticTest signextend_BigBytePlus1_2 run code:
Maximum call stack size exceeded
[Common]: vmArithmeticTest signextend_bigBytePlus1 run code:
Maximum call stack size exceeded
this is in the op-reorg branch
runCode.js needs to be updated after the tests repo has been updated
need to see if the tests repo provides the expected gas used for StateTests
(i) Cannot jump onto a jump
(ii) If a jump is preceded by a push, no jumpdest required;
(iii) jump must be directly onto JUMPDEST
(iv) no destinations into the middle of PUSH
This requires pre-processing all valid JUMPDESTs first
bug in the cpp client and updated the CallRecursiveBomb2 test
the recieptTie needs to be generated and check in runBlock
if invalid signature, nothing is output
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.