Commit Graph

39 Commits

Author SHA1 Message Date
jangko 6374c9f66d
fixes regression caused by #962 2022-02-14 21:22:39 +07:00
Jordan Hrycaj 215e9856d3
Jordan/custom network (#962)
* Rearrange/rename test_kintsugu => test_custom_network

why:
  Debug, fix and test more general problems related to running
  nimbus on a custom network.

* Update UInt265/Json parser for --custom-network command line option

why:
  As found out with the Kintsugi configuration, block number and balance
  have the same Nim type which led to misunderstandings. This patch makes
  sure that UInt265 encoded string values "0x11" decodes to 17, and "b"
  and "11" to 11.

* Refactored genesis.toBlock() => genesis.toBlockHeader()

why:
  The function toBlock(g,db) may return different results depending on
  whether the db descriptor argument is nil, or initialised. This is due
  to the db.config data sub-descriptor which may give various outcomes
  for the baseFee field of the genesis header.

  Also, the version where db is non-nil initialised is used internally
  only. So the public rewrite toBlockHeader() that replaces the toBlock()
  function expects a full set of NetworkParams.

* update comments

* Rename toBlockHeader() => toGenesisHeader()

why:
  Polymorphic prototype used for BaseChainDB or NetworkParams argument.
  With a BaseChainDB descriptor argument, the name shall imply that the
  header is generated from the config fields rather than fetched from
  the database.

* Added command line option --static-peers-file

why:
  Handy feature to keep peer nodes in a file, similar to the
  --bootstrap-file option.
2022-02-11 16:28:39 +00:00
Jordan Hrycaj 77c9b8c2f0
Kludge needed for setting up custom network (#944)
* Kludge needed for setting up custom network

why:
  Some non-features in the persistent hexary trie DB produce an assert
  error when initiating the Kinsugi network.

details:
  This fix should be temporary, only.

* Fix OS detection

why:
  directive detectOs() bails out on Windows if checking for Ubuntu
2022-02-01 12:04:20 +00:00
Kim De Mey 02afda1b45
Run everything fluffy with chronosStrictException (#889) 2021-11-18 17:52:44 +01:00
jangko e710aa9423
fixes missing emptyRlp in genesis.nim 2021-11-02 17:25:22 +07:00
jangko f0a0c1b878
cleanup: replace unnecessary initHexaryTrie with emptyRlpHash
it's simple non-sense
2021-10-28 10:48:28 +07:00
jangko a3badea928
config: fix new config based on input from jamie and zahary 2021-09-18 17:34:51 +07:00
jangko 69f2a0f95a
config: replace stdlib parseOpt with nim-confutils
fixes #581
2021-09-18 17:34:46 +07:00
jangko 48d497580a
config: remove last instance of getConfiguration usage from nimbus code
this is a preparation for migration to confutils based config
although there is still some getConfiguration usage in tests code
it will be removed after new config arrived
2021-09-08 21:25:14 +07:00
jangko c9cfebfa97
config: rearrange getConfiguration usage
avoid using getConfiguration inside object construction and
replace it with passing suitable param
2021-09-08 08:07:10 +07:00
bmoo b09ad5cacb
code cleanup removed unused imports 2021-08-18 10:35:36 +07:00
jangko db8988fe64
EIP-1559: Fee market change for ETH 1.0 chain
Transaction and BlockHeader already updated in nim-eth repo
to support EIP-1559

EIP-1559 header validation and gasLimit validation
already implemented in previous commit

This commit deals with block validation:
- Effective gasPrice per EIP-1559
- new miner reward based on priorityFee
2021-06-30 20:30:39 +07:00
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 5ee918f4ef
fixes test_graphql crash due to recent changes related to `chainId`
now test_graphql takes another route to initialize the empty db
that is safer instead of bypassing commonly used route.
2021-05-12 09:45:09 +07:00
jangko 1801317208
dealing with missing 'code' keys in customNetPrealloc 2021-04-08 08:52:40 +07:00
jangko fb7d5b5319
fixes customNetPrealloc in genesis.nim: dealing with missing keys in genesis.json 2021-04-08 08:52:40 +07:00
jangko 2cd081495b implement '--import': import rlp encoded block(s), validate, write to db and quit 2021-03-23 10:37:00 +07:00
Jacek Sieka 4ade5797ee
rlp: don't use ranges / experimental features (#495) 2020-04-20 20:12:44 +02:00
andri lim af02a3b1b2
reduce unused import warnings 2020-04-15 19:05:57 +07:00
andri lim d69ede6060 add goerli testnet genesis data[skip ci] 2020-04-09 19:13:17 +03:00
acolytec3 45cda8bab0 Add support for custom genesis blocks 2020-01-20 06:35:35 -05:00
andri lim c4dcf5da30
reduce compiler warnings 2019-11-13 21:49:39 +07:00
Jacek Sieka 2763bd0dd5
std_shims -> stew 2019-07-07 12:12:01 +02:00
Ștefan Talpalaru a67edd693a
assert() -> doAssert() 2019-03-13 22:36:54 +01: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 a098285a7b put prune switch into usage 2018-12-05 21:58:34 +07:00
Zahary Karadjov 41adca1abb Minimal changes required for building the LES branch 2018-10-16 03:10:01 +03: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
Yuriy Glukhov 5acd6cc049 newMemoryDB 2018-09-19 18:41:17 +03:00
Yuriy Glukhov 3d64c66b7a More state restoring 2018-09-19 18:41:17 +03:00
coffeepots bda219f8fe Make tests green (AccountNonce) 2018-09-02 03:26:22 +01:00
Zahary Karadjov 350188bd29 address review comments 2018-08-09 12:25:37 +03:00
Zahary Karadjov d902be66ee Fix the genesis state hash computation
The account database needed to use the secure flavour of the Hexary
Trie. This means all keys are SHA3 hashed before being inserted.
2018-08-08 15:48:34 +03:00
Yuriy Glukhov db62ef132e More comments addressed 2018-08-03 14:10:07 +03:00
Yuriy Glukhov 39d604a8d7 Fixed rinkeby alloc data 2018-08-02 17:16:34 +03:00
Yuriy Glukhov ebfe25fc2c Comments addressed 2018-08-02 17:08:10 +03:00
Yuriy Glukhov c4f4a37d2c Added genesis initialization 2018-08-01 15:50:44 +03:00