Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f8b9809
COR-1980: update SendBlockItemRequest::get_v0_format (#1463)
drsk0 Nov 3, 2025
c13dbad
Add transaction verification results for sponsored transactions.
td202 Nov 11, 2025
d6e50c4
Docs
td202 Nov 11, 2025
4251489
Naming
td202 Nov 11, 2025
9eff358
Additional results and handling.
td202 Nov 12, 2025
188d15d
Review comment.
td202 Nov 12, 2025
40b86ff
Update base after merge.
td202 Nov 12, 2025
fa6fc9e
Roll back base
td202 Nov 13, 2025
0ed3328
Merge pull request #1466 from Concordium/p10-sponsored-verifier-results
td202 Nov 13, 2025
81edd1f
SPO-9: extend AccountTransactionDetails (#1464)
drsk0 Nov 14, 2025
e6a9d08
Merge branch 'p10' into feature/sponsored-transactions
td202 Nov 18, 2025
941c557
Refactor energy charging code.
td202 Nov 14, 2025
d426af8
Renaming and refactoring.
td202 Nov 17, 2025
1625708
SPO-10: transaction verification for sponsored transactions (#1469)
drsk0 Nov 25, 2025
4d5ede2
Merge remote-tracking branch 'remotes/origin/feature/sponsored-transa…
td202 Nov 26, 2025
55751d0
Sponsored transaction fixes.
td202 Nov 25, 2025
a856de1
Fix cost computation
td202 Nov 26, 2025
13c3eb7
Scheduler tests include P10
td202 Nov 26, 2025
48fb610
Clean up
td202 Nov 26, 2025
a467288
Formatting.
td202 Nov 26, 2025
5da2f79
Some testing for grpc conversions.
td202 Nov 27, 2025
cd82e8a
Check for extended transaction when executing. Update changelog.
td202 Nov 27, 2025
0c98853
10.0.0 devnet release
td202 Nov 28, 2025
86e9f6d
Merge pull request #1470 from Concordium/sponsored-transactions-execu…
td202 Nov 28, 2025
09e88dd
Windows release image use windows-2022.
td202 Nov 28, 2025
c573565
Test sponsored transaction execution.
td202 Dec 2, 2025
77947e9
(Hopefully) fix Windows build signing on windows-latest.
td202 Dec 2, 2025
08a66a1
Make scheduler tests parallelizable.
td202 Dec 3, 2025
8f7244c
Merge pull request #1472 from Concordium/fix-windows-signing
td202 Dec 3, 2025
e5c7770
Address review comments.
td202 Dec 3, 2025
8cd9510
Add haskell code coverage.
td202 Dec 3, 2025
83e329a
Merge pull request #1471 from Concordium/SPO-59-test-sponsored-transa…
td202 Dec 4, 2025
b88a9da
Merge pull request #1473 from Concordium/haskell-coverage
td202 Dec 4, 2025
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
10 changes: 8 additions & 2 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,14 @@ jobs:
${{ runner.os }}-${{ env.dummy }}-stack-work-${{ matrix.plan.ghc }}

# Compile Haskell sources. This must be done before running checks or tests on the Rust sources.
- name: Build consensus and run tests
- name: Build consensus and run tests (with code coverage)
run: |
stack build concordium-consensus --test --bench --force-dirty --no-run-benchmarks --ghc-options "-Werror" --ghc-options -j
stack build concordium-consensus --test --bench --force-dirty --no-run-benchmarks --ghc-options "-Werror" --ghc-options -j --coverage

- name: Generate Haskell codecov report
run: |
stack install hpc-codecov
hpc-codecov stack:all -o codecov-haskell.json

# RUST #

Expand Down Expand Up @@ -284,3 +289,4 @@ jobs:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
files: lcov.info,codecov-haskell.json
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ jobs:

- name: Install DigiCert Client tools (Windows only)
id: digicert_client
uses: digicert/ssm-[email protected]
uses: digicert/code-signing-software-trust-action@v1.0.0

- name: Import Windows certificate (Windows only)
id: windows_certificate
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ xcuserdata/
/scripts/distribution/macOS-package/NodeConfigurationInstallerPlugin/*.gcno
# Code coverage report
lcov.info
# Test artefacts
.stack-work-coverage*
*.blob
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

## Unreleased changes

## 10.0.0 (DevNet)

- Updated the token module interface in accordance with adjustments to the PLT specification
<https://proposals.concordium.com/CIS/cis-7.html>
where token name, metadata and governance account are now optional in the token module initialization parameterts and
the token module state. They are still required by the current token module implementation, and initialization
without the parameters set will be rejected, so there are no observable changes to PLT behaviour.
- Fixed the `build_catchup_url` in the Ubuntu build release pipeline.
- Added boilerplate code for the upcoming P10.
- Extended the GRPC API to support submitting sponsored transactions.
- Support for sponsored transactions from protocol version 10.

## 9.0.7

Expand Down
2 changes: 1 addition & 1 deletion concordium-base
Submodule concordium-base updated 32 files
+1 −1 concordium-grpc-api
+61 −21 haskell-src/Concordium/GRPC2.hs
+1 −1 haskell-src/Concordium/Types/DummyData.hs
+39 −15 haskell-src/Concordium/Types/Execution.hs
+46 −1 haskell-src/Concordium/Types/ProtocolVersion.hs
+33 −40 haskell-src/Concordium/Types/Queries.hs
+351 −63 haskell-src/Concordium/Types/Transactions.hs
+47 −17 haskell-tests/Generators.hs
+90 −6 haskell-tests/Types/TransactionSerializationSpec.hs
+2 −1 identity-provider-service/Cargo.lock
+2 −1 idiss/Cargo.lock
+2 −1 mobile_wallet/Cargo.lock
+2 −1 rust-bins/Cargo.lock
+8 −2 rust-bins/src/bin/identity_provider_cli.rs
+2 −1 rust-src/Cargo.lock
+19 −0 rust-src/concordium_base/CHANGELOG.md
+5 −1 rust-src/concordium_base/Cargo.toml
+19 −61 rust-src/concordium_base/src/base.rs
+4 −0 rust-src/concordium_base/src/common/serialize.rs
+91 −21 rust-src/concordium_base/src/common/types.rs
+139 −13 rust-src/concordium_base/src/id/constants.rs
+12 −7 rust-src/concordium_base/src/id/id_proof_types.rs
+26 −21 rust-src/concordium_base/src/id/id_verifier.rs
+30 −1 rust-src/concordium_base/src/id/secret_sharing.rs
+360 −6 rust-src/concordium_base/src/transactions.rs
+39 −36 rust-src/concordium_base/src/updates.rs
+46 −18 rust-src/concordium_base/src/web3id/mod.rs
+3 −3 rust-src/wallet_library/src/default_wallet_config.rs
+4 −4 rust-src/wallet_library/src/statement.rs
+2 −0 smart-contracts/contracts-common/concordium-contracts-common-derive/CHANGELOG.md
+5 −15 smart-contracts/contracts-common/concordium-contracts-common-derive/src/lib.rs
+4 −4 smart-contracts/contracts-common/concordium-contracts-common/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import qualified Concordium.Scheduler.Types as Types
import Concordium.TimeMonad
import qualified Data.Bifunctor as Bifunctor

getResults :: [(a, Types.TransactionSummary)] -> [(a, Types.ValidResult)]
getResults :: [(a, Types.TransactionSummary tov)] -> [(a, Types.ValidResult)]
getResults = map $ Bifunctor.second Types.tsResult

-- | The cost for processing a simple transfer (account to account)
Expand Down Expand Up @@ -187,9 +187,9 @@ defaultContextState =
}

-- | Result from running the scheduler in a test environment.
data SchedulerResult = SchedulerResult
data SchedulerResult (tov :: Types.TransactionOutcomesVersion) = SchedulerResult
{ -- | The outcome for constructing a block.
srTransactions :: FilteredTransactions,
srTransactions :: FilteredTransactions tov,
-- | The total execution cost of the block.
srExecutionCosts :: Types.Amount,
-- | The total execution energy of the block.
Expand All @@ -204,7 +204,7 @@ runScheduler ::
TestConfig ->
BS.HashedPersistentBlockState pv ->
Types.GroupedTransactions ->
PersistentBSM pv (SchedulerResult, BS.PersistentBlockState pv)
PersistentBSM pv (SchedulerResult (Types.TransactionOutcomesVersionFor pv), BS.PersistentBlockState pv)
runScheduler TestConfig{..} stateBefore transactions = do
blockStateBefore <- BS.thawBlockState stateBefore
let txs = filterTransactions tcBlockSize (Time.timestampToUTCTime tcBlockTimeout) transactions
Expand All @@ -226,16 +226,16 @@ runScheduler TestConfig{..} stateBefore transactions = do
-- running transactions and the extractor, meaning the result of the extractor should not retain any
-- references and should be fully evaluated.
runSchedulerTest ::
forall pv a.
(Types.IsProtocolVersion pv) =>
forall tov pv a.
(Types.IsProtocolVersion pv, tov ~ Types.TransactionOutcomesVersionFor pv) =>
TestConfig ->
PersistentBSM pv (BS.HashedPersistentBlockState pv) ->
(SchedulerResult -> BS.PersistentBlockState pv -> PersistentBSM pv a) ->
(SchedulerResult tov -> BS.PersistentBlockState pv -> PersistentBSM pv a) ->
Types.GroupedTransactions ->
IO (SchedulerResult, a)
IO (SchedulerResult tov, a)
runSchedulerTest config constructState extractor transactions = runTestBlockState computation
where
computation :: PersistentBSM pv (SchedulerResult, a)
computation :: PersistentBSM pv (SchedulerResult tov, a)
computation = do
blockStateBefore <- constructState
(result, blockStateAfter) <- runScheduler config blockStateBefore transactions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ initialBlockState =
Helpers.makeTestAccountFromSeed 1_000_000 1
]

assertApplied :: Bool -> Int -> Helpers.SchedulerResult -> BS.PersistentBlockState pv -> Helpers.PersistentBSM pv ()
assertApplied :: Bool -> Int -> Helpers.SchedulerResult (TransactionOutcomesVersionFor pv) -> BS.PersistentBlockState pv -> Helpers.PersistentBSM pv ()
assertApplied assertSuccess txnCount result _state = do
let results = Helpers.getResults $ ftAdded (Helpers.srTransactions result)
if length results /= txnCount
Expand Down
12 changes: 11 additions & 1 deletion concordium-consensus/src-lib/Concordium/External.hs
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,12 @@ stopBaker cptr = mask_ $ do
-- +-------+---------------------------------------------+-----------------------------------------------------------------------------------------------+----------+
-- | 32 | ResultConsensusFailure | The consensus has thrown an exception and entered an unrecoverable state. | No |
-- +-------+---------------------------------------------+-----------------------------------------------------------------------------------------------+----------+
-- | 33 | ResultNonexistingSponsorAccount | No account corresponding to the transaction's sponsor exists. | No |
-- +-------+---------------------------------------------+-----------------------------------------------------------------------------------------------+----------+
-- | 34 | ResultMissingSponsorAccount | The transaction includes a sponsor signature but no sponsor account. | No |
-- +-------+---------------------------------------------+-----------------------------------------------------------------------------------------------+----------+
-- | 35 | ResultMissingSponsorSignature | The transaction includes a sponsor account but no sponsor signature. | No |
-- +-------+---------------------------------------------+-----------------------------------------------------------------------------------------------+----------+
type ReceiveResult = Int64

-- | Convert an 'UpdateResult' to the corresponding 'ReceiveResult' value.
Expand Down Expand Up @@ -794,6 +800,9 @@ toReceiveResult ResultEnergyExceeded = 29
toReceiveResult ResultInsufficientFunds = 30
toReceiveResult ResultDoubleSign = 31
toReceiveResult ResultConsensusFailure = 32
toReceiveResult ResultNonexistingSponsorAccount = 33
toReceiveResult ResultMissingSponsorAccount = 34
toReceiveResult ResultMissingSponsorSignature = 35

-- | Handle receipt of a block.
-- The possible return codes are @ResultSuccess@, @ResultSerializationFail@,
Expand Down Expand Up @@ -891,7 +900,8 @@ receiveFinalizationRecord bptr genIndex msg msgLen = do
-- @ResultCredentialDeploymentInvalidIP@, @ResultCredentialDeploymentInvalidAR@,
-- @ResultCredentialDeploymentExpired@, @ResultChainUpdateInvalidSequenceNumber@,
-- @ResultChainUpdateInvalidEffectiveTime@, @ResultChainUpdateInvalidSignatures@,
-- @ResultEnergyExceeded@.
-- @ResultEnergyExceeded@, @ResultNonexistingSponsorAccount@,
-- @ResultMissingSponsorAccount@, @ResultMissingSponsorSignature@.
-- Additionally @ResultConsensusFailure@ is returned if an exception occurs.
receiveTransaction :: StablePtr ConsensusRunner -> CString -> Int64 -> Ptr Word8 -> IO ReceiveResult
receiveTransaction bptr transactionData transactionLen outPtr = do
Expand Down
6 changes: 3 additions & 3 deletions concordium-consensus/src-lib/Concordium/External/DryRun.hs
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,12 @@ dryRunTransaction dryRunPtr senderPtr energyLimit payloadPtr payloadLen sigPairs
dreAvailableAmount = accBalance
}
shiQuotaRem

lift (Scheduler.dispatchTransactionBody transaction src cost) >>= \case
let checkHeaderResult = Scheduler.CheckHeaderResult src src cost
lift (Scheduler.dispatchTransactionBody transaction checkHeaderResult) >>= \case
Nothing -> do
lift . lift . liftIO $ writeIORef shiQuotaRef 0
return $ Left OutOfEnergyQuota
Just (res :: TransactionSummary' ValidResultWithReturn) -> do
Just (res :: TransactionSummary' tov ValidResultWithReturn) -> do
let newQuotaRem = shiQuotaRem - tsEnergyCost res
lift . lift . liftIO $
writeIORef shiQuotaRef newQuotaRem
Expand Down
2 changes: 1 addition & 1 deletion concordium-consensus/src/Concordium/Birk/Bake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ processTransactions ::
BlockPointerType m ->
Maybe FinalizerInfo ->
BakerId ->
m (FilteredTransactions, ExecutionResult m)
m (FilteredTransactions (TransactionOutcomesVersionFor (MPV m)), ExecutionResult m)
processTransactions slot ss bh mfinInfo bid = do
-- update the focus block to the parent block (establish invariant needed by constructBlock)
updateFocusBlockTo bh
Expand Down
17 changes: 10 additions & 7 deletions concordium-consensus/src/Concordium/GlobalState/BlockState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ class (Monad m, BlockStateTypes m) => ModuleQuery m where
-- | We create a wrapper here so we can
-- derive another 'HashableTo' instance which omits
-- the exact 'RejectReason' in the resulting hash.
newtype TransactionSummaryV1 = TransactionSummaryV1 {_transactionSummaryV1 :: TransactionSummary' ValidResult}
newtype TransactionSummaryV1 (tov :: TransactionOutcomesVersion) = TransactionSummaryV1
{ _transactionSummaryV1 :: TransactionSummary' tov ValidResult
}
deriving (Eq, Show)

-- | A 'HashableTo' instance for a 'TransactionSummary'' which omits the exact
Expand All @@ -452,12 +454,13 @@ newtype TransactionSummaryV1 = TransactionSummaryV1 {_transactionSummaryV1 :: Tr
-- bytestring. The downside is more foreign calls to the hashing function, so
-- there might be opportunities for small-scale optimizations here, but this
-- needs careful benchmarks.
instance HashableTo H.Hash TransactionSummaryV1 where
instance HashableTo H.Hash (TransactionSummaryV1 tov) where
getHash (TransactionSummaryV1 summary) =
H.hashLazy $!
S.runPutLazy $!
S.putShortByteString "TransactionOutcomeHashV1"
<> encodeSender (tsSender summary)
<> mapM_ (putMaybe S.put) (tsSponsorDetails summary)
<> S.put (tsHash summary)
<> S.put (tsCost summary)
<> S.put (tsEnergyCost summary)
Expand Down Expand Up @@ -485,14 +488,14 @@ instance HashableTo H.Hash TransactionSummaryV1 where
S.putWord8 1
S.put sender

instance (MonadBlobStore m, MonadProtocolVersion m) => BlobStorable m TransactionSummaryV1 where
instance (MonadBlobStore m, MonadProtocolVersion m, tov ~ TransactionOutcomesVersionFor (MPV m)) => BlobStorable m (TransactionSummaryV1 tov) where
storeUpdate s@(TransactionSummaryV1 ts) = return (putTransactionSummary ts, s)
load = do
s <- getTransactionSummary (protocolVersion @(MPV m))
return . return $! TransactionSummaryV1 s

-- Generic instance based on the HashableTo instance
instance (Monad m) => MHashableTo m H.Hash TransactionSummaryV1
instance (Monad m) => MHashableTo m H.Hash (TransactionSummaryV1 tov)

-- | Operations on mutable token state.
-- Note that 'updateTokenState' can only fail if a key is locked by an iterator.
Expand Down Expand Up @@ -655,7 +658,7 @@ class
getRewardStatus :: BlockState m -> m (RewardStatus' Epoch)

-- | Get the outcome of a transaction in the given block.
getTransactionOutcome :: BlockState m -> TransactionIndex -> m (Maybe TransactionSummary)
getTransactionOutcome :: BlockState m -> TransactionIndex -> m (Maybe (TransactionSummary (TransactionOutcomesVersionFor (MPV m))))

-- | Get the transactionOutcomesHash of a given block.
getTransactionOutcomesHash :: BlockState m -> m TransactionOutcomesHash
Expand All @@ -664,7 +667,7 @@ class
getStateHash :: BlockState m -> m StateHash

-- | Get all transaction outcomes for this block.
getOutcomes :: BlockState m -> m (Vec.Vector TransactionSummary)
getOutcomes :: BlockState m -> m (Vec.Vector (TransactionSummary (TransactionOutcomesVersionFor (MPV m))))

-- | Get special transactions outcomes (for administrative transactions, e.g., baker reward)
-- They should be returned in the order that they were emitted.
Expand Down Expand Up @@ -1518,7 +1521,7 @@ class (BlockStateQuery m, PLTQuery (UpdatableBlockState m) (MutableTokenState m)
bsoSetPaydayMintRate :: (PVSupportsDelegation (MPV m)) => UpdatableBlockState m -> MintRate -> m (UpdatableBlockState m)

-- | Set the transaction outcomes for the block.
bsoSetTransactionOutcomes :: UpdatableBlockState m -> [TransactionSummary] -> m (UpdatableBlockState m)
bsoSetTransactionOutcomes :: UpdatableBlockState m -> [TransactionSummary (TransactionOutcomesVersionFor (MPV m))] -> m (UpdatableBlockState m)

-- | Add a special transaction outcome.
bsoAddSpecialTransactionOutcome :: UpdatableBlockState m -> SpecialTransactionOutcome -> m (UpdatableBlockState m)
Expand Down
Loading