Commit graph

498 commits

Author SHA1 Message Date
Daniel Liu
0581dec6b7
fix(common/countdown): stabilize reset timing assertions (#2120)
Fix flaky countdown reset tests by performing an explicit second Reset before validating the second timeout window, and using a boundary-safe time check.

Observed failure:

--- FAIL: TestCountdownShouldReset (14.00s)
    countdown_test.go:53: Correctly reset the countdown once
    countdown_test.go:72: Countdown did not reset correctly second time
2026-03-10 18:42:58 +05:30
benjamin202410
bad22c2515
chore: enable reward, penalty and dynamic gas on devnet (#2121)
* chore: enable reward, penalty and dynamic gas on devnet

* update number to 3420000 for devnet

---------

Co-authored-by: liam.lai <liam.lai@babylonchain.io>
2026-03-04 20:54:18 -08:00
Daniel Liu
2611f1dd9a
fix(all): fix typo foudation (#2063) 2026-02-28 18:00:55 +04:00
Daniel Liu
ad0eea0f07
refactor(crypto): vendor in golang.org/x/crypto/sha3 #33323 (#2046)
The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2026-02-28 17:23:57 +04:00
benjamin202410
d318152a00
chore(common): setup EIP-7702 block number for devnet (#2021)
* setup eup7702 for devnet testing

* Update pragueBlock value in constants.devnet.go

---------

Co-authored-by: liam.lai <liam.lai@babylonchain.io>
2026-02-12 15:27:19 +05:30
Daniel Liu
cc2109342c
feat(core): implement EIP-2935 #29465 #30924 (#2033) 2026-02-12 09:01:26 +05:30
Daniel Liu
50210d90e3
refactor(all): remove term whitelist and blacklist (#1994) 2026-02-10 17:09:21 +05:30
Daniel Liu
81d0db2344
fix(common): fix race condition in countdown timer StopTimer method (#2014)
The TestCountdownShouldBeAbleToStop test was failing intermittently due to
a race condition in the StopTimer() implementation. Previously, the goroutine
used defer to set initilised=false, which executed after close(q) signaled
completion to StopTimer(). This allowed StopTimer() to return before the
state was properly cleaned up, causing isInitilised() checks to occasionally
see stale true values.

Fixed by explicitly calling setInitilised(false) before close(q), ensuring
the state is updated atomically before StopTimer() returns. This eliminates
the race condition and makes the test pass consistently.

Verified by running the test 30 times consecutively with no failures.
2026-02-10 16:51:42 +05:30
Daniel Liu
75c05e5dde
feat(params): start osaka fork #31125 (#2013) 2026-02-06 14:40:58 +05:30
Daniel Liu
76a53321df
common: fix block numbers for EIP-1559 and cancun (#2020) 2026-01-30 21:06:15 +08:00
wit liu
b1c239de97
common, core: fix goimports warning (#1972) 2026-01-27 08:53:31 +05:30
Daniel Liu
373eb2dc36
common/bitutil: deprecate XORBytes in favor of stdlib crypto/subtle #33331 (#1952)
XORBytes was added to package crypto/subtle in Go 1.20, and it's faster
than our bitutil.XORBytes. There is only one use of this function
across go-ethereum so we can simply deprecate the custom implementation.

---------

Co-authored-by: cui <cuiweixie@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2026-01-26 18:07:20 +05:30
Daniel Liu
1f3faa5184
all: set gas limit dynamically (#1945) 2026-01-21 10:49:20 +05:30
Daniel Liu
283d208fa3
common, core: use min to simplify code (#1939) 2026-01-16 15:53:39 +05:30
wit liu
267222d4a5
all: fix goimports warning (#1903) 2026-01-04 17:22:26 +05:30
Daniel Liu
142b1155d8
all: implement eip-7702 set code tx #30078 (#1759) 2025-12-19 14:09:45 +04:00
wit liu
75f147a362
common: simplify FileExist helper #32969 (#1871) 2025-12-19 11:07:32 +04:00
wit liu
b3d12e4fda
common: remove unused variables (#1875) 2025-12-19 10:39:23 +04:00
wit liu
66e96b507c
all: use 0x-prefix for Address type in log (#1830) 2025-12-07 15:36:36 +05:30
Daniel Liu
c6c5778632
params: define prague block #26481 #26880 (#1836) 2025-12-07 15:36:02 +05:30
Daniel Liu
ec08863ba0
all: use WaigGroup.Go() to simplify code (#1699) 2025-11-29 17:17:08 +05:30
wit liu
999b775d8e
common: fix duration comparison in PrettyAge #33064 (#1776) 2025-11-15 16:53:17 +05:30
Daniel Liu
07e2609c25
common: improve variable names for ExtractAddressFromBytes(), close XFN-27 (#1726) 2025-11-15 16:48:01 +05:30
wit liu
cbdde3fbf8
common: fix size comparison in StorageSize #33105 (#1772) 2025-11-14 20:08:01 +05:30
Daniel Liu
782a7ff5cb
all: fix typos, close XFN-23 (#1725) 2025-11-14 20:02:34 +05:30
Daniel Liu
c3c3d03551
common: fix gas fee mismatch before TIPTRC21Fee, close XFN-51 (#1636) 2025-11-03 16:24:14 +05:30
Daniel Liu
4aafff2826
common: improve function ExtractAddressFromBytes, close XFN-15 (#1658) 2025-11-03 12:56:14 +05:30
wit liu
9b0a653698
common: use tagged switch on chainID in func CopyConstants (#1579) 2025-10-08 12:28:17 +08:00
Daniel Liu
52614a59c3
common/math: fix typo in TestMustParseUint64Panic error message #32648 (#1555)
Fix typo in test error message where "MustParseBig" was incorrectly
used instead of "MustParseUint64" in the TestMustParseUint64Panic
function.

The test still functions correctly, but now the error message
accurately reflects the function being tested.

Co-authored-by: Gengar <creeptogengar@gmail.com>
2025-09-24 07:49:30 +08:00
Daniel Liu
6e5f466df9
common: remove duplicate test cases #32624 (#1556) 2025-09-22 20:43:50 +08:00
wanwiset25
ae696dc547 func CopyConstants choose local chain if unknown chainID 2025-09-14 15:21:26 +04:00
wanwiset25
a1e5a98377 update validator initial configs 2025-09-14 15:19:19 +04:00
wanwiset25
4df9699821 genesis wizard accept file input 2025-09-14 15:19:19 +04:00
Daniel Liu
31dcbc7645
eth/tracers: use slices package for sorting #27490 (#1337) 2025-09-09 15:12:22 +08:00
Daniel Liu
d2859ecb9c
common, common/hexutil: use reflect.TypeFor #32321 (#1434)
Co-authored-by: cui <cuiweixie@gmail.com>
2025-09-06 17:13:56 +08:00
Daniel Liu
1b09e585ab
common/hexutil: replace customized bit sizer with bit.Uintsize #32304 (#1433) 2025-09-06 17:13:17 +08:00
Daniel Liu
06b2524fb2
all: use fmt.Appendf instead of fmt.Sprintf where possible #31301 (#1432) 2025-09-06 17:12:19 +08:00
benjamin202410
d7412ea981
revert reward v2 block number for testing backward compatitble (#1361)
Co-authored-by: liam.lai <liam.lai@us>
2025-08-20 01:25:37 -07:00
wgr523
4ec4a5390f
Consecutive penalty upgrade (#1053)
* feat: penalty upgrade, consecutive epochs penalty
can be unpenalized

* feat: use binary search inside penalty hook

* style: modification on style

* feat: in penaltyHook change startRange

* fix: add lastPenalty condition in HookPenalty V2
2025-06-25 01:12:56 -07:00
wgr523
e13265a7d7
record total minted into smart contract (#1026)
* feat: record total minted into smart contract

* feat: GetCurrentTotalMinted API
2025-06-16 02:31:33 -07:00
Tarun Sharma
c14f2e17aa test: Updated test cases to include MaxInt64, MinInt64 and MaxUint64, also rename testcase to TestHas0xPrefix to cover Has0xPrefix public method in hexutil package 2025-05-16 12:55:45 +04:00
Tarun Sharma
631be3cc04 refactor: Removed IsValidHexString and make has0xPrefix as public as per review comment 2025-05-16 12:33:25 +04:00
Tarun Sharma
78e82ac8a9 test: updated test cases to cover hex and number support for XDPoS_getV2BlockByNumber 2025-05-09 14:32:01 +04:00
Tarun Sharma
47d4bf4bf6 common: add public method to check for valid hex string 2025-05-08 17:56:48 +04:00
Wanwiset Peerapatanapokin
d21406c43e
Merge pull request #917 from XinFinOrg/update-reward-api
add new api XDPoS_getRewardByAccount
2025-05-07 15:29:32 +04:00
benjamin202410
9656e2d1c4
update devnet reward parameter (#980)
Co-authored-by: liam.lai <liam.lai@us>
2025-04-24 03:03:32 -07:00
Daniel Liu
733a1be4dc
common, core: add block age into info logs #17718 (#947) 2025-04-24 17:56:54 +08:00
wanwiset25
52f03dd9dc add new api XDPoS_getRewardByAccount 2025-04-24 13:42:35 +04:00
Daniel Liu
c91a67c4c0
common: enable cancun after 1800 blocks in eip1559 (#942) 2025-04-16 17:07:41 +08:00
Daniel Liu
7aaf724f4f all: update parameters for rollback 2025-04-12 11:38:27 +08:00