Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/applications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ jobs:

steps:
# Setup
- name: Configure Git for Special Fix
run: |
git config --global \
url."https://${{ secrets.SPECIAL_FIX_PAT }}@github.com/".insteadOf \
"https://github.com/"

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## 3.2 (2026-07-10)

This is a major version update. This release replaces all previous versions.
The hard fork associated with this version will be triggered by miners at an unknown date.
Node administrators must upgrade as soon as possible.

This release is mandatory and fixes important reliability- and security-related issues.

To upgrade, pull the latest docker image, or download the binary and
restart the node with the same configuration file as before.

### Changes
- Upgrade to Pact 5.4.1

- New Testnet ([#22](https://github.com/kda-community/chainweb-node/pull/22))

- Manage the fork state by ForkNumbers ([#20](https://github.com/kda-community/chainweb-node/pull/20)), continuation of ([#2272](https://github.com/kadena-io/chainweb-node/commit/4aedec3bb04acd328655b17f29d41d6b077f317b))

- Upgrade several upstream libraries ([#25](https://github.com/kda-community/chainweb-node/pull/25)), ([#24](https://github.com/kda-community/chainweb-node/pull/24)), ([#29](https://github.com/kda-community/chainweb-node/pull/29))

- Fix Genesis issue with Devnet ([#28](https://github.com/kda-community/chainweb-node/pull/28))

- **TODO: Should this one be merged ??**
- Improve resiliency of the network vs. unexpected hard forks and missing blocks ([#3](https://github.com/kda-community/chainweb-node/pull/3))

- **TODO: Should this one be merged ??**
- Add an option to disable X.509 certificate validation ([#26](https://github.com/kda-community/chainweb-node/pull/26))

- **TODO: Should this one be merged ??**
- Improve initial gas handling and gas-charge signatures/proofs according to their size and complexity ([#23](https://github.com/kda-community/chainweb-node/pull/23))


## 3.1 (2025-11-25)

This is a major version update. This release replaces all previous versions.
Expand Down
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ source-repository-package

source-repository-package
type: git
location: https://github.com/kda-community/pact-5.git
tag: 7feeab02fe28bb9bfb0f1792f3ca9adffbcd2576
location: https://github.com/kda-community/pact-5-special-fix
tag: eee1d0a59a8e098e88a23b4a5eb9dc6c7d7b8444

source-repository-package
type: git
Expand Down
14 changes: 7 additions & 7 deletions cabal.project.freeze
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
hashes -benchmark-cryptonite -openssl-use-pkg-config -test-cryptonite +with-openssl,
any.haskeline ==0.8.2.1,
any.haskell-lexer ==1.2.1,
any.haskell-src-exts ==1.23.1,
any.haskell-src-meta ==0.8.15,
any.haskell-src-exts ==1.24.0,
any.haskell-src-meta ==0.8.16,
any.heaps ==0.4.1,
any.hedgehog ==1.7,
any.hourglass ==0.2.12,
Expand All @@ -221,7 +221,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
any.http-media ==0.8.1.1,
any.http-semantics ==0.4.0,
any.http-types ==0.12.5,
any.http2 ==5.4.0,
any.http2 ==5.4.1,
http2 -devel -h2spec,
any.indexed-list-literals ==0.2.1.3,
any.indexed-profunctors ==0.1.1.1,
Expand Down Expand Up @@ -300,7 +300,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
any.pact-json ==0.1.0.0,
any.pact-time ==0.3.0.1,
pact-time -with-time,
any.pact-tng ==5.4,
any.pact-tng ==5.4.1,
pact-tng +with-crypto +with-funcall-tracing +with-native-tracing,
any.pandoc ==3.10,
pandoc -embed_data_files +http,
Expand Down Expand Up @@ -346,7 +346,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
any.regex-pcre-builtin ==0.95.2.3.8.44,
any.regex-tdfa ==1.3.2.5,
regex-tdfa +doctest -force-o2,
any.resource-pool ==0.5.0.0,
any.resource-pool ==0.5.0.1,
any.resourcet ==1.3.0,
any.retry ==0.9.3.1,
retry -lib-werror,
Expand Down Expand Up @@ -484,7 +484,7 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
any.uuid ==1.3.16.1,
any.uuid-types ==1.0.6.1,
any.validation ==1.1.5,
any.vault ==0.3.1.6,
any.vault ==0.3.2.0,
vault +useghc,
any.vector ==0.13.2.0,
vector +boundschecks -internalchecks -unsafechecks -wall,
Expand Down Expand Up @@ -525,4 +525,4 @@ constraints: any.Cabal ==3.12.1.0 || ==3.14.2.0,
zip-archive -executable,
any.zlib ==0.7.1.1,
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
index-state: hackage.haskell.org 2026-07-02T11:30:46Z
index-state: hackage.haskell.org 2026-07-10T18:26:37Z
3 changes: 2 additions & 1 deletion chainweb.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.8

name: chainweb
version: 3.1
version: 3.2
synopsis: A Proof-of-Work Parallel-Chain Architecture for Massive Throughput
description: A Proof-of-Work Parallel-Chain Architecture for Massive Throughput.
homepage: https://github.com/kadena-io/chainweb
Expand Down Expand Up @@ -343,6 +343,7 @@ library
, Chainweb.Pact5.TransactionExec
, Chainweb.Pact5.Types
, Chainweb.Pact5.Validations
, Chainweb.Pact5.InitialGasModel
, Chainweb.Pact.Transactions.FungibleV2Transactions
, Chainweb.Pact.Transactions.CoinV3Transactions
, Chainweb.Pact.Transactions.CoinV4Transactions
Expand Down
3 changes: 1 addition & 2 deletions src/Chainweb/Pact/PactService.hs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ import qualified Pact.Core.Errors as Pact5
import Chainweb.Pact.Backend.Types
import qualified Chainweb.Pact.PactService.Checkpointer as Checkpointer
import Chainweb.Pact.PactService.Checkpointer (SomeBlockM(..))
import qualified Pact.Core.StableEncoding as Pact5
import Control.Monad.Cont (evalContT)
import qualified Data.List.NonEmpty as NonEmpty

Expand Down Expand Up @@ -918,7 +917,7 @@ execLocal cwtx preflight sigVerify rdepth = pactLabel "execLocal" $ do
lift (Pact5.liftPactServiceM (Pact5.assertPreflightMetadata (view Pact5.payloadObj <$> pact5Cmd) txCtx sigVerify)) >>= \case
Left err -> earlyReturn $ review _MetadataValidationFailure err
Right () -> return ()
let initialGas = Pact5.initialGasOf v cid (Pact5.ctxCurrentBlockHeight txCtx) $ Pact5._cmdPayload pact5Cmd
let initialGas = Pact5.initialGasOf v cid (Pact5.ctxCurrentBlockHeight txCtx) (Pact5.ctxParentForkNumber txCtx) pact5Cmd
applyCmdResult <- lift $ Pact5.pactTransaction Nothing (\dbEnv ->
Pact5.applyCmd
_psLogger _psGasLogger dbEnv
Expand Down
3 changes: 2 additions & 1 deletion src/Chainweb/Pact/PactService/Pact5/ExecBlock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ applyPactCmd env miner txIdxInBlock tx = StateT $ \(blockHandle, blockGasRemaini
(unsafeApplyPactCmd blockHandle
(initialGasOf (_chainwebVersion env) (Chainweb.Version._chainId env)
(env ^. psParentHeader . parentHeader . blockHeight)
(tx ^. Pact5.cmdPayload))
(env ^. psParentHeader . parentHeader . blockForkNumber)
tx)
alteredTx)
env
case resultOrGasError of
Expand Down
1 change: 0 additions & 1 deletion src/Chainweb/Pact/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ import Chainweb.Payload
import Data.ByteString.Short (ShortByteString)
import qualified Data.ByteString.Short as SB
import qualified Data.Vector as V
import qualified Pact.Core.Hash as Pact5
import Data.Maybe
import Chainweb.BlockCreationTime
import qualified Data.Aeson as Aeson
Expand Down
77 changes: 77 additions & 0 deletions src/Chainweb/Pact5/InitialGasModel.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE BangPatterns #-}

module Chainweb.Pact5.InitialGasModel
( InitialGasModel(..)
, pre31GasModel
, post31GasModel
, post32GasModel
-- Lenses
, feePerByte
, rawPayloadSizeFactor
, proofSizeFactor
, signatureSizeFactor
, sizePenalty
, signatureCost
) where

import Control.DeepSeq
import Pact.Core.Scheme
import Control.Lens


data InitialGasModel = InitialGasModel
{ _feePerByte :: Rational
-- ^ Base Price charged per byte
, _rawPayloadSizeFactor :: Rational
-- ^ Multiplier for the raw payload (without continuation proof) size
, _proofSizeFactor :: Rational
-- ^ Multiplier for the proof size
, _signatureSizeFactor :: Rational
-- ^ Multiplier for signatures size
, _sizePenalty :: Rational -> Rational
-- ^ Function used to compute a penalty for big transactions
, _signatureCost :: PPKScheme -> Rational
-- ^ Function used to compute a fixed amount of gas per signature
}

-- Required to be used as a rule
instance NFData InitialGasModel where
rnf (InitialGasModel {}) = ()

makeLenses ''InitialGasModel

pre31GasModel :: InitialGasModel
pre31GasModel = InitialGasModel
{ _feePerByte = 0.01
, _rawPayloadSizeFactor = 1.0
, _proofSizeFactor = 0.0
, _signatureSizeFactor = 0.0
, _sizePenalty = \x -> (x / 512) ^ (7 :: Integer)
, _signatureCost = const 0.0
}


post31GasModel :: InitialGasModel
post31GasModel = InitialGasModel
{ _feePerByte = 0.01
, _rawPayloadSizeFactor = 1.0
, _proofSizeFactor = 1.0
, _signatureSizeFactor = 0.0
, _sizePenalty = \x -> (x / 512) ^ (7 :: Integer)
, _signatureCost = const 0.0
}


post32GasModel :: InitialGasModel
post32GasModel = InitialGasModel
{ _feePerByte = 0.01
, _rawPayloadSizeFactor = 1.0
, _proofSizeFactor = 1.0
, _signatureSizeFactor = 1.0
, _sizePenalty = \x -> (x / 512) ^ (7 :: Integer)
, _signatureCost = \case
ED25519 -> 21.0 -- | Benchmarked at 52 ns
WebAuthn -> 526.0 -- | Benchmarked at 1.315 ms (worst case)
}
1 change: 0 additions & 1 deletion src/Chainweb/Pact5/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import "pact-json" Pact.JSON.Encode qualified as J
import "pact-json" Pact.JSON.Encode (Encode(..))
import "pact-tng" Pact.Core.ChainData
import "pact-tng" Pact.Core.Command.Types
import "pact-tng" Pact.Core.StableEncoding
import "pact-tng" Pact.Core.Errors
import "pact-tng" Pact.Core.Info
import "pact-tng" Pact.Core.Pretty qualified as Pact5
Expand Down
Loading
Loading