1

I know the actual block size is 88KB but I can't find this value in the protocol parameters.

I have ran this command in Testnet and got the following:

$ cardano-cli query protocol-parameters --testnet-magic 1097911063
{
    "maxValueSize": 5000,
    "minUTxOValue": null,
    "minPoolCost": 340000000,
    "monetaryExpansion": 3.0e-3,
    "stakeAddressDeposit": 2000000,
    "txFeeFixed": 155381,
    "poolRetireMaxEpoch": 18,
    "stakePoolDeposit": 500000000,
    "maxBlockExecutionUnits": {
        "memory": 80000000,
        "steps": 40000000000
    },
    "extraPraosEntropy": null,
    "stakePoolTargetNum": 500,
    "maxBlockHeaderSize": 1100,
    "maxCollateralInputs": 3,
    "txFeePerByte": 44,
    "treasuryCut": 0.2,
    "protocolVersion": {
        "minor": 0,
        "major": 6
    },
    "collateralPercentage": 150,
    "poolPledgeInfluence": 0.3,
    "costModels": {
        "PlutusScriptV1": {
            "mapData-memory-arguments": 32,
            "lessThanInteger-memory-arguments": 1,
            "sha3_256-cpu-arguments-slope": 82363,
            "bData-cpu-arguments": 150000,
            "equalsByteString-cpu-arguments-intercept": 112536,
            "equalsString-cpu-arguments-constant": 1000,
            "modInteger-memory-arguments-slope": 1,
            "equalsInteger-memory-arguments": 1,
            "trace-cpu-arguments": 150000,
            "iData-cpu-arguments": 150000,
            "equalsByteString-memory-arguments": 1,
            "unIData-memory-arguments": 32,
            "consByteString-memory-arguments-intercept": 0,
            "cekLamCost-exBudgetCPU": 29773,
            "indexByteString-cpu-arguments": 150000,
            "cekStartupCost-exBudgetMemory": 100,
            "listData-memory-arguments": 32,
            "divideInteger-cpu-arguments-constant": 148000,
            "lessThanInteger-cpu-arguments-intercept": 179690,
            "verifySignature-cpu-arguments-slope": 1,
            "appendString-memory-arguments-intercept": 0,
            "equalsString-cpu-arguments-slope": 1000,
            "blake2b-cpu-arguments-intercept": 2477736,
            "encodeUtf8-cpu-arguments-slope": 1000,
            "mapData-cpu-arguments": 150000,
            "equalsByteString-cpu-arguments-slope": 247,
            "multiplyInteger-cpu-arguments-intercept": 61516,
            "cekStartupCost-exBudgetCPU": 100,
            "sndPair-memory-arguments": 32,
            "sha3_256-cpu-arguments-intercept": 0,
            "addInteger-cpu-arguments-slope": 0,
            "constrData-memory-arguments": 32,
            "divideInteger-memory-arguments-intercept": 0,
            "cekForceCost-exBudgetCPU": 29773,
            "equalsByteString-cpu-arguments-constant": 150000,
            "modInteger-cpu-arguments-model-arguments-intercept": 425507,
            "sliceByteString-memory-arguments-slope": 1,
            "equalsString-memory-arguments": 1,
            "cekLamCost-exBudgetMemory": 100,
            "lessThanEqualsInteger-cpu-arguments-intercept": 145276,
            "quotientInteger-memory-arguments-minimum": 1,
            "consByteString-cpu-arguments-intercept": 150000,
            "appendByteString-memory-arguments-slope": 1,
            "lessThanByteString-cpu-arguments-slope": 248,
            "lessThanByteString-memory-arguments": 1,
            "multiplyInteger-cpu-arguments-slope": 11218,
            "cekVarCost-exBudgetCPU": 29773,
            "cekDelayCost-exBudgetMemory": 100,
            "blake2b-cpu-arguments-slope": 29175,
            "mkNilData-cpu-arguments": 150000,
            "appendByteString-cpu-arguments-slope": 621,
            "appendString-memory-arguments-slope": 1,
            "lessThanInteger-cpu-arguments-slope": 497,
            "chooseUnit-memory-arguments": 32,
            "divideInteger-cpu-arguments-model-arguments-slope": 118,
            "decodeUtf8-cpu-arguments-slope": 1000,
            "chooseData-cpu-arguments": 150000,
            "verifySignature-cpu-arguments-intercept": 3345831,
            "modInteger-memory-arguments-minimum": 1,
            "lessThanEqualsByteString-memory-arguments": 1,
            "quotientInteger-cpu-arguments-constant": 148000,
            "consByteString-memory-arguments-slope": 1,
            "tailList-memory-arguments": 32,
            "divideInteger-cpu-arguments-model-arguments-intercept": 425507,
            "decodeUtf8-cpu-arguments-intercept": 150000,
            "lessThanEqualsInteger-memory-arguments": 1,
            "appendByteString-cpu-arguments-intercept": 396231,
            "unMapData-memory-arguments": 32,
            "chooseList-cpu-arguments": 150000,
            "divideInteger-memory-arguments-minimum": 1,
            "unListData-memory-arguments": 32,
            "remainderInteger-cpu-arguments-constant": 148000,
            "addInteger-memory-arguments-slope": 1,
            "sha3_256-memory-arguments": 4,
            "lessThanByteString-cpu-arguments-intercept": 103599,
            "modInteger-cpu-arguments-constant": 148000,
            "lessThanEqualsInteger-cpu-arguments-slope": 1366,
            "appendByteString-memory-arguments-intercept": 0,
            "listData-cpu-arguments": 150000,
            "ifThenElse-memory-arguments": 1,
            "cekApplyCost-exBudgetMemory": 100,
            "sliceByteString-memory-arguments-intercept": 0,
            "unIData-cpu-arguments": 150000,
            "modInteger-cpu-arguments-model-arguments-slope": 118,
            "equalsData-cpu-arguments-intercept": 150000,
            "mkNilPairData-memory-arguments": 32,
            "cekConstCost-exBudgetCPU": 29773,
            "indexByteString-memory-arguments": 1,
            "blake2b-memory-arguments": 4,
            "lessThanEqualsByteString-cpu-arguments-slope": 248,
            "cekDelayCost-exBudgetCPU": 29773,
            "multiplyInteger-memory-arguments-slope": 1,
            "remainderInteger-memory-arguments-slope": 1,
            "subtractInteger-cpu-arguments-slope": 0,
            "iData-memory-arguments": 32,
            "cekBuiltinCost-exBudgetCPU": 29773,
            "mkNilData-memory-arguments": 32,
            "cekForceCost-exBudgetMemory": 100,
            "trace-memory-arguments": 32,
            "encodeUtf8-cpu-arguments-intercept": 150000,
            "sha2_256-cpu-arguments-intercept": 2477736,
            "headList-memory-arguments": 32,
            "unBData-cpu-arguments": 150000,
            "remainderInteger-memory-arguments-minimum": 1,
            "unMapData-cpu-arguments": 150000,
            "sha2_256-cpu-arguments-slope": 29175,
            "modInteger-memory-arguments-intercept": 0,
            "ifThenElse-cpu-arguments": 1,
            "tailList-cpu-arguments": 150000,
            "multiplyInteger-memory-arguments-intercept": 0,
            "remainderInteger-memory-arguments-intercept": 0,
            "consByteString-cpu-arguments-slope": 1000,
            "lengthOfByteString-memory-arguments": 4,
            "fstPair-memory-arguments": 32,
            "mkPairData-cpu-arguments": 150000,
            "appendString-cpu-arguments-intercept": 150000,
            "verifySignature-memory-arguments": 1,
            "sliceByteString-cpu-arguments-intercept": 150000,
            "equalsData-cpu-arguments-slope": 10000,
            "lessThanEqualsByteString-cpu-arguments-intercept": 103599,
            "chooseList-memory-arguments": 32,
            "nullList-memory-arguments": 32,
            "unListData-cpu-arguments": 150000,
            "equalsData-memory-arguments": 1,
            "quotientInteger-cpu-arguments-model-arguments-slope": 118,
            "sha2_256-memory-arguments": 4,
            "quotientInteger-cpu-arguments-model-arguments-intercept": 425507,
            "encodeUtf8-memory-arguments-intercept": 0,
            "quotientInteger-memory-arguments-slope": 1,
            "unConstrData-cpu-arguments": 150000,
            "sliceByteString-cpu-arguments-slope": 5000,
            "cekBuiltinCost-exBudgetMemory": 100,
            "equalsInteger-cpu-arguments-slope": 1326,
            "subtractInteger-memory-arguments-slope": 1,
            "mkCons-cpu-arguments": 150000,
            "chooseUnit-cpu-arguments": 150000,
            "chooseData-memory-arguments": 32,
            "bData-memory-arguments": 32,
            "appendString-cpu-arguments-slope": 1000,
            "decodeUtf8-memory-arguments-slope": 8,
            "fstPair-cpu-arguments": 150000,
            "unConstrData-memory-arguments": 32,
            "sndPair-cpu-arguments": 150000,
            "addInteger-memory-arguments-intercept": 1,
            "cekConstCost-exBudgetMemory": 100,
            "remainderInteger-cpu-arguments-model-arguments-intercept": 425507,
            "equalsString-cpu-arguments-intercept": 150000,
            "mkCons-memory-arguments": 32,
            "mkPairData-memory-arguments": 32,
            "lengthOfByteString-cpu-arguments": 150000,
            "remainderInteger-cpu-arguments-model-arguments-slope": 118,
            "cekApplyCost-exBudgetCPU": 29773,
            "constrData-cpu-arguments": 150000,
            "nullList-cpu-arguments": 150000,
            "headList-cpu-arguments": 150000,
            "decodeUtf8-memory-arguments-intercept": 0,
            "subtractInteger-cpu-arguments-intercept": 197209,
            "subtractInteger-memory-arguments-intercept": 1,
            "encodeUtf8-memory-arguments-slope": 8,
            "equalsInteger-cpu-arguments-intercept": 136542,
            "quotientInteger-memory-arguments-intercept": 0,
            "cekVarCost-exBudgetMemory": 100,
            "unBData-memory-arguments": 32,
            "addInteger-cpu-arguments-intercept": 197209,
            "mkNilPairData-cpu-arguments": 150000,
            "divideInteger-memory-arguments-slope": 1
        }
    },
    "maxTxExecutionUnits": {
        "memory": 16000000,
        "steps": 10000000000
    },
    "executionUnitPrices": {
        "priceSteps": 7.21e-5,
        "priceMemory": 5.77e-2
    },
    "decentralization": 0,
    "utxoCostPerWord": 34482,
    "maxTxSize": 16384,
    "maxBlockBodySize": 98304
}

I have looked for 90112 (since that's 88 * 1024 - in bytes), but no luck either.

What's the right way of getting the max block size from here?

2 Answers 2

4

You can get this info from the live chain protocol-parameters and filter on the string block, as per below:

$ cardano-cli query protocol-parameters --mainnet |grep -i block
    "maxBlockExecutionUnits": {
    "maxBlockHeaderSize": 1100,
    "maxBlockBodySize": 90112

90112 / 1024 = 88KB

3
  • Ok, this is exactly what I was doing. So basically what this is telling me is that the maxBlockBodySize in Testnet is 96KB (98304 / 1024) instead of 88KB bytes. Is this correct? Jun 2, 2022 at 8:46
  • I haven't tried this on testnet, but if you're getting 98304 then yeah it looks like they are running with a larger block size when compared to mainnet. Jun 2, 2022 at 9:05
  • Yes, that's it. Cheers! Jun 2, 2022 at 9:25
0

You are looking in the wrong place. You are looking at the genesis config for one of the eras (Alonzo maybe?).

The max_block_size is set in the on-chain epoch paramaters which cardano-db-sync stores in the epoch_param table. My db-sync is only synced to epoch 336 so I do not get the latest epochs:

select epoch_no, max_block_size from epoch_param where epoch_no >= 320 order by epoch_no ;
 epoch_no | max_block_size 
----------+----------------
      320 |          81920
      321 |          81920
      322 |          81920
      323 |          81920
      324 |          81920
      325 |          81920
      326 |          81920
      327 |          81920
      328 |          81920
      329 |          81920
      330 |          81920
      331 |          81920
      332 |          81920
      333 |          81920
      334 |          81920
      335 |          90112
      336 |          90112
(17 rows)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.