Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit 8b79f99

Browse files
authored
merge master into evm/main #2278
2 parents 462941c + 4d1e082 commit 8b79f99

33 files changed

+1129
-328
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
## 2.23.2 (2025-10-22)
2+
This is a minor point release. Upgrading is **strongly recommended**.
3+
4+
To upgrade, pull the latest docker image, or download the binary and
5+
restart the node with the same configuration file as before.
6+
7+
### Changes
8+
- Limit sizes of response bodies coming from peers [`a07cc75`](https://github.com/kadena-io/chainweb-node/commit/a07cc756167340b2ee6362d42da21a5a64b83070)
9+
- Add more logging to the mempool [`f864fa1`](https://github.com/kadena-io/chainweb-node/commit/f864fa1a8af4c3d6a55a5b52f142afd91c2ddf9f)
10+
11+
## 2.31.1 (2025-10-09)
12+
This is a minor point release. Upgrading is **strongly recommended**.
13+
14+
To upgrade, pull the latest docker image, or download the binary and
15+
restart the node with the same configuration file as before.
16+
17+
### Changes
18+
- Properly update service date in mainnet and testnet. [`0abf6e3`](https://github.com/kadena-io/chainweb-node/commit/0abf6e3df6f8c02ff084a4f07cf6f8f09e5d64e4)
19+
20+
## 2.31 (2025-10-06)
21+
This is a major version update. This release replaces all previous versions.
22+
23+
Any prior version will stop working on **2025-10-15T00:00:00Z**. Node administrators must
24+
upgrade to this version before that date. The 2.31 feature upgrade will
25+
occur at block height 6269344 which is estimated to be mined at **2025-10-16T00-00-00Z**.
26+
27+
### Changes
28+
- Upgrade to Pact 5.4 [`937b13a`](https://github.com/kadena-io/chainweb-node/commit/937b13ae8b9624df03b8f850baab3bbfaf35a598)
29+
- SPV Proof roots now expire after 20,000 blocks. [`138578c`](https://github.com/kadena-io/chainweb-node/commit/138578cf9a40b0593ee15fb2adc74500991eafd6)
30+
131
## 2.30 (2025-07-07)
232
This is a major version update. This release replaces all previous versions.
333

cabal.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ source-repository-package
119119
source-repository-package
120120
type: git
121121
location: https://github.com/kadena-io/kadena-ethereum-bridge.git
122-
tag: 7e0adf227b5a9c335c3c3840aba36252356c7225
123-
--sha256: 1knhscph2g3saz0pjd1d5a32mr281msapccfrillgd2qk4pj7xjc
122+
tag: 96bff6b35b2a2b6bf63f9d19b536f0c61102be36
123+
--sha256: 0czl48hhlk8fl63jprg719x3ngrinhj6xs5rqm9cfzpcygp4wz4q
124124

125125
source-repository-package
126126
type: git

cabal.project.freeze

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
9393
any.character-ps ==0.1,
9494
any.charset ==0.3.12,
9595
any.chronos ==1.1.7.0,
96-
any.citeproc ==0.10,
96+
any.citeproc ==0.11,
9797
citeproc -executable -icu,
9898
any.clock ==0.8.4,
9999
clock -llvm,
@@ -132,11 +132,9 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
132132
any.crypton-socks ==0.6.2,
133133
crypton-socks -example +network-3-0-0-0,
134134
any.crypton-x509 ==1.7.7,
135-
any.crypton-x509-store ==1.6.11,
135+
any.crypton-x509-store ==1.6.12,
136136
any.crypton-x509-system ==1.6.7,
137137
any.crypton-x509-validation ==1.6.14,
138-
any.cryptonite ==0.30,
139-
cryptonite -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq -support_pclmuldq +support_rdrand -support_sse +use_target_attributes,
140138
cwtools -debug -ed25519 -ghc-flags -remote-db,
141139
any.data-bword ==0.1.0.2,
142140
any.data-default ==0.8.0.1,
@@ -170,7 +168,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
170168
entropy -donotgetentropy,
171169
any.erf ==2.0.0.0,
172170
any.errors ==2.3.0,
173-
any.ethereum ==0.1.0.2,
171+
any.ethereum ==0.1.1,
174172
ethereum -ethhash -openssl-use-pkg-config,
175173
any.exceptions ==0.10.9,
176174
any.extra ==1.8,
@@ -299,10 +297,10 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
299297
pact-time -with-time,
300298
any.pact-tng ==5.4,
301299
pact-tng +with-crypto +with-funcall-tracing +with-native-tracing,
302-
any.pandoc ==3.8.2,
300+
any.pandoc ==3.8.2.1,
303301
pandoc -embed_data_files,
304302
any.pandoc-types ==1.23.1,
305-
any.parallel ==3.2.2.0,
303+
any.parallel ==3.3.0.0,
306304
any.parsec ==3.1.18.0,
307305
any.parser-combinators ==1.3.0,
308306
parser-combinators -dev,
@@ -314,7 +312,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
314312
poly +sparse,
315313
any.pretty ==1.1.3.6,
316314
any.pretty-show ==1.10,
317-
any.pretty-simple ==4.1.3.0,
315+
any.pretty-simple ==4.1.4.0,
318316
pretty-simple -buildexample +buildexe,
319317
any.prettyprinter ==1.7.1,
320318
prettyprinter -buildreadme +text,
@@ -393,14 +391,14 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
393391
any.split ==0.2.5,
394392
any.splitmix ==0.1.3.1,
395393
splitmix -optimised-mixer,
396-
any.statistics ==0.16.3.0,
394+
any.statistics ==0.16.4.0,
397395
statistics -benchpapi,
398396
any.stm ==2.5.3.1,
399397
any.stm-chans ==3.0.0.9,
400398
any.stopwatch ==0.1.0.7,
401399
stopwatch -test_delay_upper_bound -test_threaded,
402400
any.streaming ==0.2.4.0,
403-
any.streaming-commons ==0.2.3.0,
401+
any.streaming-commons ==0.2.3.1,
404402
streaming-commons -use-bytestring-builder,
405403
any.strict ==0.5.1,
406404
any.syb ==0.7.3,
@@ -442,7 +440,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
442440
any.time-locale-compat ==0.1.1.5,
443441
time-locale-compat +old-locale,
444442
any.time-manager ==0.2.3,
445-
any.tls ==2.1.11,
443+
any.tls ==2.1.12,
446444
tls -devel,
447445
any.tls-session-manager ==0.0.8,
448446
any.token-bucket ==0.1.0.1,
@@ -462,7 +460,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
462460
any.typst-symbols ==0.1.8.1,
463461
any.unicode-collation ==0.1.3.6,
464462
unicode-collation -doctests -executable,
465-
any.unicode-data ==0.6.0,
463+
any.unicode-data ==0.8.0,
466464
unicode-data -dev-has-icu,
467465
any.unicode-transforms ==0.4.0.1,
468466
unicode-transforms -bench-show -dev -has-icu -has-llvm -use-gauge,
@@ -521,4 +519,4 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
521519
zip-archive -executable,
522520
any.zlib ==0.7.1.1,
523521
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
524-
index-state: hackage.haskell.org 2025-10-09T04:46:48Z
522+
index-state: hackage.haskell.org 2025-10-28T19:25:40Z

chainweb.cabal

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.8
22

33
name: chainweb
4-
version: 2.30
4+
version: 2.31.2
55
synopsis: A Proof-of-Work Parallel-Chain Architecture for Massive Throughput
66
description: A Proof-of-Work Parallel-Chain Architecture for Massive Throughput.
77
homepage: https://github.com/kadena-io/chainweb
@@ -159,6 +159,7 @@ library
159159
, Chainweb.BlockHeader.Genesis.Mainnet10to19Payload
160160
, Chainweb.BlockHeader.Validation
161161
, Chainweb.BlockHeaderDB
162+
, Chainweb.BlockHeaderDB.HeaderOracle
162163
, Chainweb.BlockHeaderDB.Internal
163164
, Chainweb.BlockHeaderDB.PruneForks
164165
, Chainweb.BlockHeaderDB.RemoteDB
@@ -290,6 +291,7 @@ library
290291
, Chainweb.VerifierPlugin.Hyperlane.Message.After225
291292
, Chainweb.VerifierPlugin.Hyperlane.Message.Before225
292293
, Chainweb.VerifierPlugin.Hyperlane.Utils
294+
, Chainweb.VerifierPlugin.SignedList
293295
, Chainweb.Version
294296
, Chainweb.Version.Development
295297
, Chainweb.Version.EvmDevelopment
@@ -581,7 +583,7 @@ library chainweb-test-utils
581583
, pact-time:numeric >=0.3.0.1
582584
, pact-tng >=5.0
583585
, pact-tng:pact-request-api >=5.0
584-
, property-matchers ^>= 0.7
586+
, property-matchers
585587
, quickcheck-instances >= 0.3
586588
, random >= 1.3
587589
, resourcet >= 1.3
@@ -673,6 +675,8 @@ test-suite chainweb-tests
673675
Chainweb.Test.Pact4.SQLite
674676
Chainweb.Test.Pact4.TransactionTests
675677
Chainweb.Test.Pact4.VerifierPluginTest
678+
Chainweb.Test.Pact.SignedListPluginTests
679+
Chainweb.Test.ResponseSizeLimiter
676680
Chainweb.Test.RestAPI
677681
Chainweb.Test.Roundtrips
678682
-- Chainweb.Test.SPV
@@ -738,7 +742,8 @@ test-suite chainweb-tests
738742
, pact-tng:test-utils
739743
, pact-tng:pact-repl
740744
, prettyprinter
741-
, property-matchers ^>= 0.7
745+
, property-matchers
746+
, pretty-show
742747
, quickcheck-instances >= 0.3
743748
, random >= 1.3
744749
, random-shuffle >= 0.0.4
@@ -763,6 +768,7 @@ test-suite chainweb-tests
763768
, unordered-containers >= 0.2.20
764769
, vector >= 0.12.2
765770
, wai >= 3.2
771+
, wai-extra >= 3.1
766772
, warp >= 3.3.6
767773
, warp-tls >= 3.4
768774
if flag(ed25519)
@@ -926,6 +932,7 @@ benchmark bench
926932
, property-matchers >= 0.7
927933
, text >= 2.0
928934
, vector >= 0.12.2
935+
, yaml >= 0.11
929936

930937
-- The build of all Pact related benchmarks is currently broken in the
931938
-- evm branch and the build of the respective modules is disable. The
@@ -948,4 +955,3 @@ benchmark bench
948955
-- , tasty-hunit
949956
-- , unordered-containers
950957
-- , yaml >= 0.11
951-

cwtools/cwtools.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.8
22

33
name: cwtools
4-
version: 2.30
4+
version: 2.31.2
55
synopsis: A collection of various tools for Chainweb users and developers.
66
description: A collection of various tools for Chainweb users and developers.
77
homepage: https://github.com/kadena-io/chainweb

default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ let haskellSrc = with nix-filter.lib; filter {
7777
zlib
7878
pkg-config
7979
sqlite
80+
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
81+
pkgs.darwin.apple_sdk.frameworks.Security
8082
];
8183
modules = [
8284
{

node/chainweb-node.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.8
22

33
name: chainweb-node
4-
version: 2.30
4+
version: 2.31.2
55
synopsis: A Proof-of-Work Parallel-Chain Architecture for Massive Throughput
66
description: A Proof-of-Work Parallel-Chain Architecture for Massive Throughput.
77
homepage: https://github.com/kadena-io/chainweb
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{-# language
2+
DerivingStrategies
3+
, ImportQualifiedPost
4+
, LambdaCase
5+
, OverloadedRecordDot
6+
, RecordWildCards
7+
, ScopedTypeVariables
8+
, TypeApplications
9+
#-}
10+
11+
module Chainweb.BlockHeaderDB.HeaderOracle
12+
(
13+
-- * Oracle type
14+
HeaderOracle
15+
-- ** Accessors
16+
, lowerBound
17+
, upperBound
18+
19+
-- * Oracle creation
20+
, create
21+
, createSpv
22+
-- ** Oracle creation Exceptions
23+
, InvalidHeaderOracleBounds(..)
24+
25+
-- * Oracle querying
26+
, query
27+
, HeaderOracleResponse(..)
28+
)
29+
where
30+
31+
import Chainweb.BlockHash (BlockHash)
32+
import Chainweb.BlockHeader (BlockHeader, blockHash, blockHeight, genesisBlockHeader)
33+
import Chainweb.BlockHeaderDB (BlockHeaderDb)
34+
import Chainweb.TreeDB (seekAncestor)
35+
import Chainweb.TreeDB qualified as TreeDB
36+
import Chainweb.Version
37+
import Chainweb.Version.Guards (minimumBlockHeaderHistory)
38+
import Control.Exception (Exception(..), throwIO)
39+
import Control.Lens (view)
40+
import Numeric.Natural (Natural)
41+
42+
-- | A 'HeaderOracle' is a 'BlockHeaderDb' with a lower and upper bound, and the only
43+
-- query on it is whether a given block is within those bounds.
44+
data HeaderOracle = HeaderOracle
45+
{ lowerBound :: !BlockHeader
46+
, upperBound :: !BlockHeader
47+
, db :: !BlockHeaderDb
48+
}
49+
50+
-- | Create a new 'HeaderOracle' specifically for SPV verification, with the given upper bound.
51+
--
52+
-- The lower bound of the oracle is determined by the 'spvProofExpirationWindow'.
53+
createSpv :: HasVersion => BlockHeaderDb -> BlockHeader -> IO HeaderOracle
54+
createSpv db upperBound = do
55+
let mWindow = minimumBlockHeaderHistory (view blockHeight upperBound)
56+
let gh = genesisBlockHeader upperBound
57+
let defaultOracle = create db gh upperBound
58+
59+
case mWindow of
60+
Nothing -> do
61+
defaultOracle
62+
Just window -> do
63+
mWindowthAncestor <- do
64+
let w = fromIntegral @_ @Natural window
65+
let ur = TreeDB.rank upperBound
66+
let gr = TreeDB.rank gh
67+
-- Saturated subtraction with the genesis rank as origin
68+
if w + gr <= ur
69+
then do
70+
seekAncestor db upperBound (ur - w)
71+
else do
72+
return Nothing
73+
case mWindowthAncestor of
74+
Nothing -> do
75+
defaultOracle
76+
Just windowthAncestor -> do
77+
create db windowthAncestor upperBound
78+
79+
-- | Exception thrown when creating a new 'HeaderOracle' with invalid bounds.
80+
data InvalidHeaderOracleBounds = InvalidHeaderOracleBounds !BlockHash !BlockHash
81+
deriving stock (Eq, Show)
82+
83+
instance Exception InvalidHeaderOracleBounds where
84+
displayException (InvalidHeaderOracleBounds l u) = "Header Oracle `create` called with a (lower, upper) pair, where `lower` is not an ancestor of `upper`: " ++ show (l, u)
85+
86+
-- | Create a new 'HeaderOracle' with the given lower and upper bounds.
87+
--
88+
-- Throws an 'InvalidHeaderOracleBounds' exception if the lower bound is not an ancestor of the upper bound.
89+
create :: HasVersion => BlockHeaderDb -> BlockHeader -> BlockHeader -> IO HeaderOracle
90+
create db lowerBound upperBound = do
91+
valid <- TreeDB.ancestorOf db (view blockHash lowerBound) (view blockHash upperBound)
92+
if valid
93+
then do
94+
return HeaderOracle
95+
{ ..
96+
}
97+
else do
98+
throwIO $ InvalidHeaderOracleBounds (view blockHash lowerBound) (view blockHash upperBound)
99+
100+
-- | The response from the oracle when querying a block.
101+
--
102+
-- We would ideally like something like
103+
-- @
104+
-- data Response = TooLate | OutOfBounds | InBounds
105+
-- @
106+
-- but shallow nodes can't determine the difference between something
107+
-- that is too late and something that is out of bounds.
108+
data HeaderOracleResponse
109+
= OutOfBounds
110+
-- ^ The block is not within the oracle's bounds.
111+
| InBounds
112+
-- ^ The block is within the oracle's bounds.
113+
deriving stock (Eq)
114+
115+
-- | Query the oracle, asking if the block is within its bounds.
116+
query
117+
:: HasVersion
118+
=> HeaderOracle
119+
-> BlockHash
120+
-> IO HeaderOracleResponse
121+
query oracle subject = do
122+
-- Check if the lower bound is an ancestor of the header
123+
-- Check if the header is an ancestor of the upper bound
124+
r <- (&&)
125+
<$> TreeDB.ancestorOf oracle.db (view blockHash oracle.lowerBound) subject
126+
<*> TreeDB.ancestorOf oracle.db subject (view blockHash oracle.upperBound)
127+
return $ if r
128+
then InBounds
129+
else OutOfBounds

src/Chainweb/BlockHeaderDB/PruneForks.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ import Chainweb.Cut
8080
import Chainweb.CutDB
8181
import Control.Monad.Cont
8282
import Data.Void (Void)
83-
import Data.Foldable (toList)
83+
import Data.Foldable
8484
import Data.Functor ((<&>))
8585
import Data.Ord
8686
import Control.Concurrent

0 commit comments

Comments
 (0)