-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cost model page in the user guide (#6582)
- Loading branch information
Showing
2 changed files
with
20 additions
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
sidebar_position: 15 | ||
--- | ||
|
||
# Cost Model | ||
|
||
The cost model is used to determine the portion of the transaction fee that accounts for Plutus script execution. | ||
It assigns execution units, consisting of a CPU component and a memory component, to the execution of a Plutus script, which is then used to calculate the corresponding fee in Ada. | ||
|
||
Cardano is designed for determinism. | ||
The script execution fee, and indeed the entire transaction fee, can be accurately predicted off-chain before the transaction is submitted. | ||
Unlike some other blockchains, there's no risk of a script incurring higher costs on-chain than expected. | ||
On Cardano, the fee calculated when running the script locally is the exact fee charged on-chain[^1]. | ||
|
||
To learn more about the cost model, take a look at [An overview of the Plutus Core cost model](https://github.com/IntersectMBO/plutus/blob/master/doc/cost-model-overview/cost-model-overview.pdf). | ||
|
||
--- | ||
|
||
[^1]: A transaction may of course be rejected for reasons such as some input UTXOs no longer exist, in which case the script won't be executed. | ||
If the script is executed, the fee will be exactly as predicted. |
c8a10ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.05
.validation-auction_1-1
289.3
μs254.8
μs1.14
validation-crowdfunding-success-2
236.8
μs210.6
μs1.12
validation-crowdfunding-success-3
236.5
μs209.7
μs1.13
validation-currency-1
270.2
μs252.5
μs1.07
validation-escrow-redeem_1-1
381.3
μs351.3
μs1.09
validation-escrow-redeem_1-2
539.8
μs349.3
μs1.55
validation-escrow-redeem_2-1
630.7
μs409.7
μs1.54
validation-escrow-redeem_2-2
627.9
μs408.8
μs1.54
validation-escrow-redeem_2-3
627.7
μs409.7
μs1.53
validation-escrow-refund-1
248.7
μs156.2
μs1.59
validation-future-increase-margin-1
384.4
μs251.1
μs1.53
validation-future-increase-margin-2
825.1
μs565.4
μs1.46
validation-future-increase-margin-3
822.5
μs540.9
μs1.52
validation-future-increase-margin-4
737.8
μs490.3
μs1.50
validation-future-increase-margin-5
1208
μs822.4
μs1.47
validation-future-pay-out-1
383.2
μs251.7
μs1.52
validation-future-pay-out-2
820.2
μs539
μs1.52
validation-future-pay-out-3
822.2
μs651.1
μs1.26
validation-future-settle-early-1
383
μs358.2
μs1.07
validation-future-settle-early-3
823.4
μs765.1
μs1.08
validation-game-sm-success_1-1
592.9
μs554.5
μs1.07
validation-game-sm-success_1-2
324.5
μs284.6
μs1.14
validation-game-sm-success_1-3
963.3
μs908
μs1.06
validation-game-sm-success_1-4
378.6
μs332.5
μs1.14
validation-game-sm-success_2-1
593
μs552.8
μs1.07
validation-game-sm-success_2-2
324.4
μs285
μs1.14
validation-game-sm-success_2-3
963.2
μs911.4
μs1.06
validation-game-sm-success_2-4
378.6
μs332.3
μs1.14
validation-game-sm-success_2-5
959.7
μs911.2
μs1.05
validation-game-sm-success_2-6
377.9
μs332
μs1.14
validation-multisig-sm-1
598.1
μs560.7
μs1.07
validation-multisig-sm-2
585.9
μs486.6
μs1.20
validation-multisig-sm-3
594.1
μs544.4
μs1.09
validation-multisig-sm-4
600.4
μs560.1
μs1.07
validation-multisig-sm-5
838.9
μs792.1
μs1.06
validation-multisig-sm-6
599.9
μs560.8
μs1.07
validation-multisig-sm-7
585.2
μs492.2
μs1.19
validation-multisig-sm-8
594.1
μs551.2
μs1.08
validation-ping-pong-1
496.8
μs464.3
μs1.07
validation-ping-pong-2
499.1
μs464.8
μs1.07
validation-ping-pong_2-1
312.9
μs284.4
μs1.10
validation-prism-1
271.6
μs239.5
μs1.13
validation-prism-2
635.1
μs582.8
μs1.09
validation-prism-3
556.7
μs525.8
μs1.06
validation-stablecoin_1-1
1362
μs1297
μs1.05
validation-stablecoin_1-2
317.9
μs277.4
μs1.15
validation-stablecoin_1-3
1571
μs1491
μs1.05
validation-stablecoin_1-4
337.9
μs296.5
μs1.14
validation-stablecoin_2-2
221.9
μs196.5
μs1.13
validation-stablecoin_2-4
245
μs209
μs1.17
validation-token-account-1
292.2
μs190.3
μs1.54
validation-token-account-2
517.6
μs336.2
μs1.54
validation-uniswap-1
619.3
μs415.7
μs1.49
validation-uniswap-2
345.4
μs256.3
μs1.35
validation-uniswap-3
2632
μs1774
μs1.48
validation-uniswap-4
544.5
μs479.3
μs1.14
validation-uniswap-5
1756
μs1225
μs1.43
validation-uniswap-6
514.5
μs318.9
μs1.61
validation-vesting-1
528.9
μs348.3
μs1.52
validation-decode-auction_2-2
742.9
μs653.3
μs1.14
validation-decode-auction_2-3
742.8
μs568.9
μs1.31
validation-decode-auction_2-4
740
μs525.2
μs1.41
validation-decode-auction_2-5
269.7
μs189.9
μs1.42
validation-decode-escrow-redeem_2-2
332.4
μs305.7
μs1.09
validation-decode-escrow-redeem_2-3
441.2
μs306.1
μs1.44
validation-decode-escrow-refund-1
441.7
μs306.3
μs1.44
validation-decode-future-increase-margin-1
268.4
μs225.5
μs1.19
validation-decode-future-increase-margin-2
441.2
μs308.2
μs1.43
validation-decode-future-increase-margin-3
443.5
μs307.8
μs1.44
validation-decode-future-increase-margin-4
944.7
μs659.2
μs1.43
validation-decode-future-increase-margin-5
948.8
μs657.8
μs1.44
validation-decode-future-pay-out-1
322.4
μs225
μs1.43
validation-decode-future-pay-out-2
450.5
μs308.2
μs1.46
validation-decode-future-pay-out-3
442.4
μs308
μs1.44
validation-decode-future-settle-early-3
409.8
μs308.5
μs1.33
validation-decode-future-settle-early-4
949.6
μs657.7
μs1.44
validation-decode-game-sm-success_1-1
724.4
μs502.5
μs1.44
validation-decode-game-sm-success_1-2
227.8
μs158.5
μs1.44
validation-decode-game-sm-success_1-3
720.6
μs504.9
μs1.43
validation-decode-game-sm-success_1-4
230.2
μs158.9
μs1.45
validation-decode-game-sm-success_2-1
724.7
μs502.8
μs1.44
validation-decode-game-sm-success_2-2
224.9
μs158.5
μs1.42
validation-decode-game-sm-success_2-3
720.5
μs502.9
μs1.43
validation-decode-game-sm-success_2-4
227.6
μs158.6
μs1.44
validation-decode-game-sm-success_2-5
719.3
μs518.7
μs1.39
validation-decode-multisig-sm-1
804.5
μs555.8
μs1.45
validation-decode-multisig-sm-2
802
μs757.4
μs1.06
validation-decode-multisig-sm-3
669.6
μs556
μs1.20
validation-decode-multisig-sm-4
604.7
μs561.9
μs1.08
validation-decode-multisig-sm-6
613.9
μs561
μs1.09
validation-decode-multisig-sm-7
755.5
μs718.9
μs1.05
validation-decode-ping-pong-2
672.5
μs497.1
μs1.35
validation-decode-stablecoin_1-2
228.5
μs156.5
μs1.46
validation-decode-stablecoin_1-3
1134
μs830
μs1.37
validation-decode-stablecoin_1-5
917.1
μs829.5
μs1.11
validation-decode-stablecoin_1-6
228.8
μs157.7
μs1.45
validation-decode-stablecoin_2-1
1185
μs830.1
μs1.43
validation-decode-stablecoin_2-2
226
μs156
μs1.45
validation-decode-stablecoin_2-3
1189
μs828.5
μs1.44
validation-decode-stablecoin_2-4
229.6
μs158.6
μs1.45
validation-decode-token-account-2
298.4
μs268.8
μs1.11
validation-decode-uniswap-1
329.7
μs227.3
μs1.45
validation-decode-uniswap-2
326
μs228.1
μs1.43
validation-decode-uniswap-3
1020
μs711.9
μs1.43
validation-decode-uniswap-4
250
μs173.4
μs1.44
validation-decode-uniswap-5
1020
μs708.1
μs1.44
validation-decode-uniswap-6
250.8
μs172.4
μs1.45
marlowe-semantics/383683bfcecdab0f4df507f59631c702bd11a81ca3841f47f37633e8aacbb5de
1080
μs919.1
μs1.18
marlowe-semantics/a9a853b6d083551f4ed2995551af287880ef42aee239a2d9bc5314d127cce592
719.6
μs521.8
μs1.38
marlowe-semantics/cdb9d5c233b288a5a9dcfbd8d5c1831a0bb46eec7a26fa31b80ae69d44805efc
1253
μs880.2
μs1.42
marlowe-semantics/ced1ea04649e093a501e43f8568ac3e6b37cd3eccec8cac9c70a4857b88a5eb8
912.3
μs839.2
μs1.09
marlowe-semantics/f2a8fd2014922f0d8e01541205d47e9bb2d4e54333bdd408cbe7c47c55e73ae4
783.7
μs733.9
μs1.07
marlowe-semantics/f339f59bdf92495ed2b14e2e4d3705972b4dda59aa929cffe0f1ff5355db8d79
6536
μs4670
μs1.40
marlowe-semantics/ffdd68a33afd86f8844c9f5e45b2bda5b035aa02274161b23d57709c0f8b8de6
1203
μs956.6
μs1.26
marlowe-role-payout/0004000402010401030101030100040000010104020201030001000204020401
268.6
μs188
μs1.43
marlowe-role-payout/0100000100010000000001000100010101000101000001000000010000010000
313.7
μs257.7
μs1.22
marlowe-role-payout/0202010002010100020102020102020001010101020102010001010101000100
215.1
μs172.5
μs1.25
marlowe-role-payout/0303020000020001010201060303040208070100050401080304020801030001
247.2
μs173.2
μs1.43
marlowe-role-payout/031d56d71454e2c4216ffaa275c4a8b3eb631109559d0e56f44ea8489f57ba97
292.7
μs206.1
μs1.42
marlowe-role-payout/03d730a62332c51c7b70c16c64da72dd1c3ea36c26b41cd1a1e00d39fda3d6cc
276.3
μs194.9
μs1.42
marlowe-role-payout/0403020000030204010000030001000202010101000304030001040404030100
257.6
μs179.4
μs1.44
marlowe-role-payout/0405010105020401010304080005050800040301010800080207080704020206
282
μs198.4
μs1.42
marlowe-role-payout/041a2c3b111139201a3a2c173c392b170e16370d300f2d28342d0f2f0e182e01
281.5
μs198.6
μs1.42
marlowe-role-payout/04f592afc6e57c633b9c55246e7c82e87258f04e2fb910c37d8e2417e9db46e5
326.8
μs230
μs1.42
marlowe-role-payout/057ebc80922f16a5f4bf13e985bf586b8cff37a2f6fe0f3ce842178c16981027
240.9
μs170.5
μs1.41
marlowe-role-payout/06317060a8e488b1219c9dae427f9ce27918a9e09ee8ac424afa33ca923f7954
253.7
μs178.6
μs1.42
marlowe-role-payout/07658a6c898ad6d624c37df1e49e909c2e9349ba7f4c0a6be5f166fe239bfcae
232.6
μs177
μs1.31
marlowe-role-payout/121a0a1b12030616111f02121a0e070716090a0e031c071419121f141409031d
238.4
μs219.6
μs1.09
marlowe-role-payout/159e5a1bf16fe984b5569be7011b61b5e98f5d2839ca7e1b34c7f2afc7ffb58e
243.6
μs170.8
μs1.43
marlowe-role-payout/195f522b596360690d04586a2563470f2214163435331a6622311f7323433f1c
237.2
μs166.6
μs1.42
marlowe-role-payout/1a20b465d48a585ffd622bd8dc26a498a3c12f930ab4feab3a5064cfb3bc536a
263.2
μs186.1
μs1.41
marlowe-role-payout/371c10d2526fc0f09dbe9ed59e44dcd949270b27dc42035addd7ff9f7e0d05e7
287
μs265.6
μs1.08
This comment was automatically generated by workflow using github-action-benchmark.
CC: @IntersectMBO/plutus-core