Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ cardano-tracer/cardano-tracer-test
.idea/

.codex

.serena/
2 changes: 1 addition & 1 deletion bench/plutus-scripts-bench/plutus-scripts-bench.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ library
-- IOG dependencies
--------------------------
build-depends:
, cardano-api ^>=11.0
, cardano-api ^>=11.3
, plutus-ledger-api ^>=1.63
, plutus-tx ^>=1.63
, plutus-tx-plugin ^>=1.63
Expand Down
4 changes: 2 additions & 2 deletions bench/tx-generator/tx-generator.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ library
, attoparsec-aeson
, base16-bytestring
, bytestring
, cardano-api ^>= 11.0
, cardano-api ^>= 11.3
, cardano-binary
, cardano-cli ^>= 11.0
, cardano-cli ^>= 11.1
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-data
Expand Down
3 changes: 1 addition & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2026-04-17T09:20:55Z
, cardano-haskell-packages 2026-05-02T16:21:41Z
, cardano-haskell-packages 2026-05-27T09:43:46Z

active-repositories:
, :rest
Expand Down Expand Up @@ -90,4 +90,3 @@ allow-newer:
-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

2 changes: 1 addition & 1 deletion cardano-node-chairman/cardano-node-chairman.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ test-suite chairman-tests
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -T"

build-tool-depends: cardano-node:cardano-node
, cardano-cli:cardano-cli ^>= 11.0
, cardano-cli:cardano-cli ^>= 11.1
, cardano-node-chairman:cardano-node-chairman
4 changes: 2 additions & 2 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ library
, async
, base16-bytestring
, bytestring
, cardano-api ^>= 11.0
, cardano-api ^>= 11.3
, cardano-data
, cardano-crypto-class ^>=2.3
, cardano-crypto-wrapper
Expand All @@ -156,7 +156,7 @@ library
, cardano-prelude
, cardano-protocol-tpraos >= 1.4
, cardano-slotting >= 0.2
, cardano-rpc ^>= 10.2
, cardano-rpc ^>= 11.0
, cborg ^>= 0.2.4
, containers
, contra-tracer
Expand Down
1 change: 1 addition & 0 deletions cardano-node/src/Cardano/Node/Protocol/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module Cardano.Node.Protocol.Shelley

import Cardano.Api hiding (FileError)
import qualified Cardano.Api as Api
import Cardano.Api.Experimental.Certificate (OperationalCertificate (..), getHotKey)

import qualified Cardano.Crypto.Hash.Class as Crypto
import Cardano.Ledger.BaseTypes (ProtVer (..), natVersion)
Expand Down
9 changes: 6 additions & 3 deletions cardano-node/src/Cardano/Node/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import Cardano.Node.Protocol.Types
import Cardano.Node.Queries
import Cardano.Rpc.Server
import Cardano.Rpc.Server.Config
import Data.IORef
import Cardano.Node.Startup
import Cardano.Node.TraceConstraints (TraceConstraints)
import Cardano.Node.Tracing.API
Expand Down Expand Up @@ -541,6 +542,7 @@ handleSimpleNode blockType runP tracers nc networkMagic onKernel = do
#endif
nForkPolicy <- getForkPolicy $ ncResponderCoreAffinityPolicy nc
cForkPolicy <- getForkPolicy $ ncResponderCoreAffinityPolicy nc
nodeAccessRef <- newIORef Nothing
void $
let diffusionNodeArguments :: Cardano.Diffusion.CardanoNodeArguments IO
diffusionNodeArguments = Cardano.Diffusion.CardanoNodeArguments {
Expand Down Expand Up @@ -573,7 +575,7 @@ handleSimpleNode blockType runP tracers nc networkMagic onKernel = do
(readTVar ledgerPeerSnapshotVar)
nc
in
withAsync (rpcServerLoop (startupTracer tracers) (rpcTracer tracers) rpcConfigVar networkMagic) $ \_ ->
withAsync (rpcServerLoop (startupTracer tracers) (rpcTracer tracers) rpcConfigVar networkMagic nodeAccessRef) $ \_ ->
Node.run
nodeArgs {
rnNodeKernelHook = \registry nodeKernel -> do
Expand Down Expand Up @@ -858,16 +860,17 @@ rpcServerLoop :: Tracer IO (StartupTrace blk)
-> Tracer IO TraceRpc
-> StrictTVar IO RpcConfig
-> NetworkMagic
-> IORef (Maybe (NodeAccess IO))
-> IO ()
rpcServerLoop startupTracer rpcTracer rpcConfigVar networkMagic = go
rpcServerLoop startupTracer rpcTracer rpcConfigVar networkMagic nodeAccessRef = go
where
go = do
config@RpcConfig{isEnabled = Identity enabled} <- readTVarIO rpcConfigVar
if enabled
then
race_
(do
runRpcServer rpcTracer (config, networkMagic)
runRpcServer rpcTracer config networkMagic nodeAccessRef
traceWith startupTracer RpcForceDisabled
disableRpcServer)
(waitForRpcConfigChange config)
Expand Down
24 changes: 24 additions & 0 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Rpc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ instance LogFormatting TraceRpc where
[ "queryName" .= String "ReadUtxos"
, spanToObject s
]
TraceRpcQuerySearchUtxosSpan s ->
[ "queryName" .= String "SearchUtxos"
, spanToObject s
]
TraceRpcSubmit submitTrace ->
["kind" .= String "SubmitService"]
<> case submitTrace of
TraceRpcSubmitN2cConnectionError _ -> []
TraceRpcSubmitTxDecodingError _ -> []
TraceRpcSubmitTxValidationError _ -> []
TraceRpcSubmitSpan s -> [spanToObject s]
TraceRpcEvalTxDecodingError _ -> []
TraceRpcEvalTxSpan s -> [spanToObject s]

forHuman = docToText . pretty

Expand All @@ -50,7 +56,9 @@ instance LogFormatting TraceRpc where
-- query names here are taken from UTXORPC spec: https://utxorpc.org/query/intro/#operations
TraceRpcQuery (TraceRpcQueryParamsSpan (SpanBegin _)) -> [CounterM "rpc.request.QueryService.ReadParams" Nothing]
TraceRpcQuery (TraceRpcQueryReadUtxosSpan (SpanBegin _)) -> [CounterM "rpc.request.QueryService.ReadUtxos" Nothing]
TraceRpcQuery (TraceRpcQuerySearchUtxosSpan (SpanBegin _)) -> [CounterM "rpc.request.QueryService.SearchUtxos" Nothing]
TraceRpcSubmit (TraceRpcSubmitSpan (SpanBegin _)) -> [CounterM "rpc.request.SubmitService.SubmitTx" Nothing]
TraceRpcSubmit (TraceRpcEvalTxSpan (SpanBegin _)) -> [CounterM "rpc.request.SubmitService.EvalTx" Nothing]
_ -> []

instance MetaTrace TraceRpc where
Expand All @@ -63,45 +71,58 @@ instance MetaTrace TraceRpc where
: case queryTrace of
TraceRpcQueryParamsSpan _ -> ["ReadParams", "Span"]
TraceRpcQueryReadUtxosSpan _ -> ["ReadUtxos", "Span"]
TraceRpcQuerySearchUtxosSpan _ -> ["SearchUtxos", "Span"]
TraceRpcSubmit submitTrace ->
"SubmitService"
: case submitTrace of
TraceRpcSubmitN2cConnectionError _ -> ["N2cConnectionError"]
TraceRpcSubmitTxDecodingError _ -> ["TxDecodingError"]
TraceRpcSubmitTxValidationError _ -> ["TxValidationError"]
TraceRpcSubmitSpan _ -> ["SubmitTx", "Span"]
TraceRpcEvalTxDecodingError _ -> ["EvalTxDecodingError"]
TraceRpcEvalTxSpan _ -> ["EvalTx", "Span"]

severityFor (Namespace _ nsInner) _ = case nsInner of
["FatalError"] -> Just Error -- RPC server startup errors
["Error"] -> Just Debug -- those are normal operation errors, like request errors, hide them by default
["QueryService", "ReadParams", "Span"] -> Just Debug
["QueryService", "ReadUtxos", "Span"] -> Just Debug
["QueryService", "SearchUtxos", "Span"] -> Just Debug
["SubmitService", "SubmitTx", "Span"] -> Just Debug
["SubmitService", "EvalTx", "Span"] -> Just Debug
["SubmitService", "N2cConnectionError"] -> Just Warning -- this is a more serious error, this shouldn't happen
["SubmitService", "TxDecodingError"] -> Just Debug -- request error
["SubmitService", "TxValidationError"] -> Just Debug -- request error
["SubmitService", "EvalTxDecodingError"] -> Just Debug -- request error
_ -> Nothing

documentFor (Namespace _ nsInner) = case nsInner of
["FatalError"] -> Just "RPC startup critical error."
["Error"] -> Just "Normal operation errors such as request errors. Those are not harmful to the RPC server itself."
["QueryService", "ReadParams", "Span"] -> Just "Span for the ReadParams UTXORPC method."
["QueryService", "ReadUtxos", "Span"] -> Just "Span for the ReadUtxos UTXORPC method."
["QueryService", "SearchUtxos", "Span"] -> Just "Span for the SearchUtxos UTXORPC method."
["SubmitService", "SubmitTx", "Span"] -> Just "Span for the SubmitTx UTXORPC method."
["SubmitService", "EvalTx", "Span"] -> Just "Span for the EvalTx UTXORPC method."
["SubmitService", "N2cConnectionError"] ->
Just
"Node connection error. This should not happen, as this means that there is an issue in cardano-rpc configuration."
["SubmitService", "TxDecodingError"] -> Just "A regular request error, when submitted transaction decoding fails."
["SubmitService", "TxValidationError"] -> Just "A regular request error, when submitted transaction is invalid."
["SubmitService", "EvalTxDecodingError"] -> Just "A regular request error, when evalTx transaction decoding fails."
_ -> Nothing

metricsDocFor (Namespace _ nsInner) = case nsInner of
["QueryService", "ReadParams", "Span"] ->
[("rpc.request.QueryService.ReadParams", "Span for the ReadParams UTXORPC method.")]
["QueryService", "ReadUtxos", "Span"] ->
[("rpc.request.QueryService.ReadUtxos", "Span for the ReadUtxos UTXORPC method.")]
["QueryService", "SearchUtxos", "Span"] ->
[("rpc.request.QueryService.SearchUtxos", "Span for the SearchUtxos UTXORPC method.")]
["SubmitService", "SubmitTx", "Span"] ->
[("rpc.request.SubmitService.SubmitTx", "Span for the SubmitTx UTXORPC method.")]
["SubmitService", "EvalTx", "Span"] ->
[("rpc.request.SubmitService.EvalTx", "Span for the EvalTx UTXORPC method.")]
_ -> []

allNamespaces =
Expand All @@ -110,10 +131,13 @@ instance MetaTrace TraceRpc where
, ["Error"]
, ["QueryService", "ReadParams", "Span"]
, ["QueryService", "ReadUtxos", "Span"]
, ["QueryService", "SearchUtxos", "Span"]
, ["SubmitService", "SubmitTx", "Span"]
, ["SubmitService", "EvalTx", "Span"]
, ["SubmitService", "N2cConnectionError"]
, ["SubmitService", "TxDecodingError"]
, ["SubmitService", "TxValidationError"]
, ["SubmitService", "EvalTxDecodingError"]
]

-- helper functions
Expand Down
4 changes: 2 additions & 2 deletions cardano-submit-api/cardano-submit-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ library
, aeson
, async
, bytestring
, cardano-api ^>= 11.0
, cardano-api ^>= 11.3
, cardano-binary
, cardano-cli ^>= 11.0
, cardano-cli ^>= 11.1
, cardano-crypto-class ^>=2.3
, containers
, ekg-core
Expand Down
4 changes: 2 additions & 2 deletions cardano-submit-api/src/Cardano/TxSubmit/Web.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Cardano.Api (AllegraEra, AnyCardanoEra (AnyCardanoEra), AsType
LocalNodeConnectInfo (LocalNodeConnectInfo, localConsensusModeParams, localNodeNetworkId, localNodeSocketPath),
NetworkId, SerialiseAsCBOR (..), ShelleyBasedEra (..), ShelleyEra, SocketPath,
ToJSON, Tx, TxId (..), TxInMode (TxInMode), TxValidationErrorInCardanoMode (..),
getTxBody, getTxId, submitTxToNodeLocal)
getTxId, submitTxToNodeLocal)
import qualified Cardano.Api

import Cardano.Binary (DecoderError (..))
Expand Down Expand Up @@ -144,7 +144,7 @@ txSubmitPost trace p@(CardanoModeParams cModeParams) networkId socketPath txByte
case res of
Cardano.Api.TxSubmitSuccess -> do
liftIO $ T.putStrLn "Transaction successfully submitted."
return $ getTxId (getTxBody tx)
let Tx txBody _ = tx in return $ getTxId txBody
Cardano.Api.TxSubmitFail e ->
left $ TxCmdTxSubmitValidationError e
Cardano.Api.TxSubmitError e ->
Expand Down
6 changes: 4 additions & 2 deletions cardano-testnet/cardano-testnet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ library
, annotated-exception
, ansi-terminal
, bytestring
, cardano-api ^>= 11.0
, cardano-cli:{cardano-cli, cardano-cli-test-lib} ^>= 11.0
, cardano-api ^>= 11.3
, cardano-cli:{cardano-cli, cardano-cli-test-lib} ^>= 11.1
, cardano-crypto-class ^>=2.3
, cardano-crypto-wrapper
, cardano-git-rev ^>= 0.2.2
Expand Down Expand Up @@ -238,7 +238,9 @@ test-suite cardano-testnet-test
Cardano.Testnet.Test.Gov.TreasuryDonation
Cardano.Testnet.Test.Gov.TreasuryGrowth
Cardano.Testnet.Test.Gov.TreasuryWithdrawal
Cardano.Testnet.Test.Rpc.Eval
Cardano.Testnet.Test.Rpc.Query
Cardano.Testnet.Test.Rpc.SearchUtxos
Cardano.Testnet.Test.Rpc.Transaction
Cardano.Testnet.Test.Misc
Cardano.Testnet.Test.Node.Shutdown
Expand Down
2 changes: 1 addition & 1 deletion cardano-testnet/src/Testnet/Process/Cli/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Testnet.Process.Cli.DRep
, makeActivityChangeProposal
) where

import Cardano.Api hiding (Certificate, TxBody, txId)
import Cardano.Api hiding (TxBody, txId)
import Cardano.Api.Experimental (Some (..))
import Cardano.Api.Ledger (EpochInterval (EpochInterval, unEpochInterval))

Expand Down
1 change: 1 addition & 0 deletions cardano-testnet/src/Testnet/Process/Cli/SPO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Testnet.Process.Cli.SPO
) where

import Cardano.Api hiding (cardanoEra)
import Cardano.Api.Experimental.Certificate (PoolId)
import qualified Cardano.Api.Ledger as L

import qualified Cardano.Ledger.Shelley.LedgerState as L
Expand Down
2 changes: 1 addition & 1 deletion cardano-testnet/src/Testnet/Process/Cli/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Testnet.Process.Cli.Transaction
)
where

import Cardano.Api hiding (Certificate, TxBody)
import Cardano.Api hiding (TxBody)
import Cardano.Api.Experimental (Some (..))

import Prelude
Expand Down
1 change: 1 addition & 0 deletions cardano-testnet/src/Testnet/Property/Assert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Testnet.Property.Assert


import Cardano.Api hiding (Value)
import Cardano.Api.Experimental.Certificate (PoolId)

import Prelude hiding (lines)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import qualified Cardano.Api.Ledger as L

import Cardano.CLI.Type.Common
import Cardano.Crypto.Hash.Class (hashToStringAsHex)
import qualified Cardano.Ledger.Core as L
import Cardano.Testnet

import Prelude
Expand Down
Loading
Loading