The conditions mentioned in the old TODO comment have been checked. All
fixtures have either 40 hex digits or empty string for "to". There is a test
with all-zeros, and it means send to that account, not contract creation.
Empty string means contract creation.
This patch does not change the relaxed parsing where fewer than 40 digits is
accepted. We should probably be stricter about this.
Signed-off-by: Jamie Lokier <jamie@shareable.org>
There is no valid `CREATE_CONTRACT_ADDRESS`. Some places on the internet say
account zero means contract creation, but that's not correct.
Transactions to `ZERO_ADDRESS` are legitimate transfers to that account, not
contract creations. They are used to "burn" Eth. People also send Eth to
address zero by accident, unrecoverably, due to poor user interface issues.
Signed-off-by: Jamie Lokier <jamie@shareable.org>
Each place in `call_evm` that sets up an EVM call calculates the new contract
address for contract creations. But it's redundant, because `newComputation`
ignores the provided value and does the calculation again.
Remove the unused address calculation.
This is also a step to merging different entry points and EVMC. This change
ends up with the same value in both `msg.contractAddress` and `msg.codeAddress`
for every entry point, and this is good because it matches the EVMC message
structure, where they are replaced by only one value called `msg.destination`
Signed-off-by: Jamie Lokier <jamie@shareable.org>
`c.executeOpcodes` is called by some JSON fixture tests. These tests bypass
some of the setup and return, and because of this call, continuations aren't
processed either. Opcodes that use continuations will behave incorrectly.
The opcodes used in these particular tests don't use continuations currently,
so just add some assertions to verify this remains the case.
This is only used by local tests, and the call to `c.executeOpcodes` will be
replaced by the common entry point (that handles things like this correctly in
all cases) so we don't need to spend more time on this.
Signed-off-by: Jamie Lokier <jamie@shareable.org>
why:
previously, table data were stored with the table iterator. while
loading a table with permuted entries will always reconstruct equivalent
tables (in the sense of `==`), serialisation data are not comparable.
this patch produces always the same serialised data for equivalent
tables.
why:
source-local unit tests would hardly be triggered by github CI as rightly
criticised with the last patch.
details:
source-local unit tests have been moved to tests folder.
this version also contains rlp serialisation code so rlp encode/decode
will apply tranparently. this is not needed in p2p/validate but will be
useful with the clique protocol.
why:
to be used in Clique consensus protocol which suggests 4k cache entries.
the previous implementation used OrderTable[] which has complexity O(n)
for deleting entries.
additional flags we use:
- [x] HIVE_NETWORK_ID network ID number to use for the eth protocol
- [x] HIVE_LOGLEVEL client loglevel (0-5)
- [x] HIVE_GRAPHQL_ENABLED enables graphql on port 8545
hive always set 'HIVE_FORK_DAO_VOTE' to '1'.
set 'daoForkSupport' to 'true' if only 'HIVE_FORK_DAO_BLOCK'
is set by hive, not depends only on 'HIVE_FORK_DAO_VOTE'.
This is because 'nimbus-eth1' internal is different compared to 'geth'.
after EIP2718/EIP2930, we have additional fields:
type AccessTuple {
address: Address!
storageKeys : [Bytes32!]
}
type Transaction {
r: BigInt!
s: BigInt!
v: BigInt!
# Envelope transaction support
type: Int
accessList: [AccessTuple!]
}
close#606
now we have hive simulators written in nim:
- ethereum/consensus
- ethereum/graphql
Using these simulators, we can debug test cases without have to run
hive or docker.
when a skipped test case not in the skip list
but skipped using `testStatusIMPL`, the generated
markdown file list it as failed.
now that bug is fixed.
now test_blockchain_json is using block validation code
from p2p/executor.nim instead of using it's own
block validation code.
this will reduce maintenance cost and fixes#592.