Commit graph

10 commits

Author SHA1 Message Date
Daniel Liu
ed95075f03
fix(params): accept legacy foudationwalletaddr in chain config, fix #2063 (#2141)
Add backward-compatible XDPoSConfig JSON decoding for the legacy key
"foudationWalletAddr" introduced before PR #2063 renamed it to
"foundationWalletAddr".

Without this compatibility layer, old on-disk chain configs are decoded with a
zero FoundationWalletAddr, causing XDPoSConfigEqual mismatch and startup rewind
("mismatching XDPoS not equal in database").

This patch:
- Implements custom UnmarshalJSON for XDPoSConfig that reads both keys.
- Prefers foundationWalletAddr when both keys are present.
- Keeps existing behavior for all other fields.
- Adds regression tests for legacy-key decoding and precedence.

Validation:
- go test ./params/...
2026-03-07 06:37:24 +08:00
Daniel Liu
7267895b82
params: improve function BuildConfigIndex() (#1935) 2026-01-16 15:49:03 +05:30
benjamin202410
f8decab061
code refactor for performance (#782)
Co-authored-by: liam.lai <liam.lai@us>
2024-12-29 21:47:14 -08:00
Liam
47bfdf7635
Move masternode in v2 config (#372)
* move masternode in v2 config

* update number to meet 7 vote for current setup

* add test

* update all failed test

* fix test

* remove comment

* remove comment

* fix test
2023-11-29 11:11:58 +11:00
Liam
c215316744
Make masternode dynamic (#356)
* make masternode dynamic

* fix all the tests

* remove cmt

* fix test again
2023-11-16 23:59:19 +11:00
Liam Lai
fc5b7d1bbc add testnet constant parameter 2023-02-16 12:08:58 +08:00
Jerome
2ca1d0461d
Fix issue when resync is not getting the right consensus config values (#221)
* Fix issue when resync is not getting the right consensus config values

* add test and fix log bug

* fix test

* delete temp file

Co-authored-by: Liam Lai <liam.icheng.lai@gmail.com>
2023-01-17 21:34:42 +08:00
Liam
c4f9a552e5
Multi config bug fix (#216)
* refactor multi config
remove pool cleaner
correct message and log level
2022-12-17 20:23:46 +08:00
Péter Szilágyi
6d6a5a9337 cmd, consensus, core, miner: instatx clique for --dev (#15323)
* cmd, consensus, core, miner: instatx clique for --dev

* cmd, consensus, clique: support configurable --dev block times

* cmd, core: allow --dev to use persistent storage too
2017-10-24 13:40:42 +03:00
Felix Lange
37dd9086ec core: refactor genesis handling
This commit solves several issues concerning the genesis block:

* Genesis/ChainConfig loading was handled by cmd/geth code. This left
  library users in the cold. They could specify a JSON-encoded
  string and overwrite the config, but didn't get any of the additional
  checks performed by geth.
* Decoding and writing of genesis JSON was conflated in
  WriteGenesisBlock. This made it a lot harder to embed the genesis
  block into the forthcoming config file loader. This commit changes
  things so there is a single Genesis type that represents genesis
  blocks. All uses of Write*Genesis* are changed to use the new type
  instead.
* If the chain config supplied by the user was incompatible with the
  current chain (i.e. the chain had already advanced beyond a scheduled
  fork), it got overwritten. This is not an issue in practice because
  previous forks have always had the highest total difficulty. It might
  matter in the future though. The new code reverts the local chain to
  the point of the fork when upgrading configuration.

The change to genesis block data removes compression library
dependencies from package core.
2017-03-23 15:58:43 +01:00