Commit Graph

45 Commits

Author SHA1 Message Date
jangko a0d10f5728
drop PublicNetwork enum usage and replace it with NetworkId
we cannot limit the `--networkid` switch to values available in
`PublicNetwork` enum. it should able to accept very wide range of
custom NetworkId.
2021-05-20 14:04:16 +07:00
jangko f2491e6307
fixes crappy custom genesis and chain config parser
instead of using stdlib/json, now we switch to json_serialization
the result is much tidier code and more robust when parsing
optional fields.

fixes #635
2021-05-13 16:04:08 +07:00
jangko f6a0e4bcbd
fixes wrong usage of `chainId` in places where it should be networkId
fixes #643
2021-05-12 09:45:09 +07:00
jangko 82d4f6a2d4
fixes getReceipts proc signature in db_chain.nim
instead of using header as input param, now getReceipts using
receiptRoot hash, the intention is clearer and less data passed around
when we only using receiptRoot instead of whole block header.
2021-04-24 10:51:05 +07:00
jangko 1728dd8d54
fix getTransactionCount bug in db_chain.nim
getTransactionCount will always return 0 because the txCount
variable is not returned
2021-04-24 10:47:37 +07:00
jangko f987e86562
implement more eth rpc 2020-07-30 14:21:11 +07:00
jangko c9802edfce
setup block and state env for more complex eth rpc tests 2020-07-28 23:48:45 +07:00
jangko f82dff64fa
implement more eth rpc and keystore management 2020-07-23 14:54:32 +07:00
jangko 336efdb0c3
implement web3, net, and some eth namespace rpc 2020-07-22 23:57:55 +07:00
Jacek Sieka 4ade5797ee
rlp: don't use ranges / experimental features (#495) 2020-04-20 20:12:44 +02:00
andri lim c4dcf5da30
reduce compiler warnings 2019-11-13 21:49:39 +07:00
andri lim 3ad465d169 implement block validation and friends 2019-09-26 12:33:43 +03:00
Jacek Sieka 2763bd0dd5
std_shims -> stew 2019-07-07 12:12:01 +02:00
andri lim 8a9e4aba80
apply dao fork changes 2019-04-07 06:53:26 +07:00
andri lim f2f92f5608
fix block 1.487.668 problem: getScore int overflow 2019-04-05 16:29:05 +07:00
andri lim e2311d798b
fix recurring symbol collision problem 2019-03-07 22:53:09 +07:00
andri lim 2c032ad1ab refactor utils 2019-02-27 13:30:18 +02:00
Yuriy Glukhov 481c6cf4ed Use nim-eth (#224) 2019-02-05 20:15:50 +01:00
andri lim 0c887b3711 move initializeEmptyDb to genesis.nim 2019-01-15 15:30:25 +02:00
andri lim 281b7dffac implement debug_setHead 2019-01-06 13:17:08 +02:00
andri lim e78fb72ef6 fixes #188 2019-01-06 13:16:45 +02:00
andri lim ab0fb7fdf0 fix getScore 32bit bug 2019-01-06 11:43:38 +02:00
andri lim a6bf970b1b some cleanup 2019-01-06 11:43:38 +02:00
Ștefan Talpalaru 048a43b2f1
better error handling
- added some useful `chronicles` defines in the top-level nim.cfg
- converted some assert() calls to error codes to avoid a reported
  segfault with -d:release
- the recoverable errors are being recovered from, in persistWorkItem()
- the only case that's a show stopper raises an exception
2018-12-17 23:36:38 +01:00
andri lim ad1202f98a initial make_receipt 2018-12-16 15:38:51 +02:00
andri lim c954dc7d62 fix tests 2018-12-05 22:01:29 +07:00
andri lim a098285a7b put prune switch into usage 2018-12-05 21:58:34 +07:00
andri lim 21070d510d add TransactionKey to persistTransactions and add more fat to debug_traceTransaction 2018-11-28 09:25:36 +07:00
andri lim 161d6adbc7 implement persistTransactions and getBlockBody 2018-11-24 08:00:58 +07:00
Zahary Karadjov 343cc4fa43 Populate the persistent databases with the empty RLP key.
Also implements transactional block persistence. Two issues
in the transaction processing code have been discovered that
might affect other usages such as the CALL instruction.

The main fix gets us past block 49000.

You may need to clean up your database.
2018-10-05 03:36:48 +03:00
Zahary Karadjov 74f6f0b738 Deal with the refactoring in status-im/nim-rlp#20 2018-09-26 12:58:23 +03:00
tersec 690ce2cf97
Partly fix state_db getCode for 20 new working GeneralStateTests (#156)
* partly fix state_db getCode to get 20 new working GeneralStateTests; remove 2 functions which existed as workarounds; switch all remaining setBalance calls in GeneralStateTestRunner to subBalance (addBalance calls already changed)

* two of the 20 new tests don't work in 32-bit builds
2018-09-20 21:36:57 +00:00
coffeepots 213aebde7d Update some comments, adding TODO item for getStateDb 2018-09-14 16:16:55 +01:00
Yuriy Glukhov 3a1ec035b3 Various fixes towards state reconstruction 2018-09-07 14:00:37 +03:00
Yuriy Glukhov e3be8ca30a Separate Chain from ChainDB 2018-08-29 11:49:01 +03:00
coffeepots 67e9f47ac5 Add getTransactionKey 2018-08-21 13:33:37 +01:00
Yuriy Glukhov e4929d4f60 Slightly reworked ChainDB interface to more consistent 2018-08-03 14:56:49 +03:00
Yuriy Glukhov c4f4a37d2c Added genesis initialization 2018-08-01 15:50:44 +03:00
Yuriy Glukhov 84515b78a9 Align DB backend interfaces with eth_trie. Init BaseChainDB in nimbus. 2018-07-30 16:05:32 +03:00
zah 18b7bbb3b0 Implemented most of the stubbed-out state handling instructions (#59)
Merge note: currently cannot compile due to `quasiBoolean` (#63). This will be solved by https://github.com/status-im/nimbus/pull/65
----

* Implemented most of the stubbed out state handling instructions

The code compiles, but still fails at the moment due to incorrect

initialization of the VM. Don't merge yet. More commits will be
pushed in the coming days.

* Fixed crash

* trie put and del are void now

* getBlockTransactionData and getReceipts

* Working code for extcodesize0.json

* fix origin.json

* fix calldatasize1

* fix calldataloadSizeTooHighPartial

* fix calldataloadSizeTooHigh

* more efficient PushX implementation

* fix and, or, xor
2018-07-05 14:41:01 +02:00
Zahary Karadjov 583c72fa54 Implement storage backends using RocksDB and SQLite 2018-06-26 13:46:54 +03:00
Yuriy Glukhov 1c79d1ab3d Persist* functions 2018-06-24 18:37:02 +03:00
Mamy Ratsimbazafy 90c3ca4a96
Gas refactoring - decouple opcode logic and gas (#49)
* Decoupling op logic and gas - introduce gasometer, rework opcode declaration

* Remove gas constants for gas opcode computation

* Remove gas constants for precompiled contracts

* make vm_types compile

* Make opcode, call and computation compile

* Distinguish between dynamic and complex gas costs, fix arithmetic

* Fix context and sha3

* update memory and storage ops

* Log opcode uses memory expansion code

* update/stub system_ops with gas costs

* Make test compile. Deactivate stub test_vm

* all tests compiles, opcode fails due to https://github.com/nim-lang/Nim/issues/8007 (const object variant in tables reset at runtime)

* Create an enum without holes - workaround: https://github.com/nim-lang/Nim/issues/8007

* Use arrays instead of tables for GasCosts, remove some unused imports - passing all basic tests!

* Make test_vm_json compile

* Fix test_vm_json - workaround https://github.com/nim-lang/Nim/issues/8015

* fix memory expansion cost bug

* Remove leftover special handling from before GckMemExpansion

* cleanup outdated comment, better align =

* Fix sha3 gas cost not taking memory expansion into account

* Improve gas error reporting of test_vm_json

* Fix gas computation regression due to mem expansion

* mass replace for memExpansion->RequestedMemSize was too eager

* fix log gas cost (no tests :/)

* missed a static FeeSchedule

* static as expression is fickle
2018-06-12 17:33:47 +02:00
Yuriy Glukhov 8bdf09683b Hash256/EthAddrres refactoring 2018-05-30 19:11:15 +03:00
Yuriy Glukhov 51b572d8b8 Some renames 2018-05-28 13:22:28 +03:00