You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is still a terrible mess but drafts nicely what I have in mind for the future contract format.
Some additional things
need to properly test kwarg stlye parameter passing. ideally configure statically somewhere else
opshin init create a stub contract and modify pyproject toml to store some compiler configs, pin opshin version
the resolution of the datum and purpose should either use native uplc, independent of the name of attributes in the plutusv3 api def -- or it should reuse the logic from the prelude.
Loading baseline measurements...
Measuring current binary sizes and execution costs...
Measuring assert_sum...
O0: 55074 bytes
Evaluating test case: valid_sum
CPU: 44,217,759 | MEM: 239,874
O1: 3816 bytes
Evaluating test case: valid_sum
CPU: 19,721,759 | MEM: 86,774
O2: 3810 bytes
Evaluating test case: valid_sum
CPU: 19,682,516 | MEM: 86,542
O3: 1354 bytes
Evaluating test case: valid_sum
CPU: 17,874,516 | MEM: 75,242
Measuring liquidity_pool...
O0: 151810 bytes
O1: 47734 bytes
O2: 47468 bytes
O3: 18594 bytes
Measuring marketplace...
O0: 124076 bytes
O1: 26428 bytes
O2: 26332 bytes
O3: 4778 bytes
Measuring gift...
O0: 57642 bytes
Evaluating test case: valid_withdrawal
CPU: 52,463,891 | MEM: 267,363
O1: 5580 bytes
Evaluating test case: valid_withdrawal
CPU: 29,439,891 | MEM: 123,463
O2: 5574 bytes
Evaluating test case: valid_withdrawal
CPU: 29,361,405 | MEM: 122,999
O3: 1684 bytes
Evaluating test case: valid_withdrawal
CPU: 26,913,405 | MEM: 107,699
Measuring wrapped_token...
O0: 64774 bytes
O1: 9516 bytes
O2: 9226 bytes
O3: 3826 bytes
Measuring micropayments...
O0: 88246 bytes
O1: 21198 bytes
O2: 21124 bytes
O3: 7250 bytes
Measuring pool_validator...
O0: 63204 bytes
Evaluating test case: swap_a_for_b
CPU: 144,496,682 | MEM: 550,657
Evaluating test case: swap_b_for_a
CPU: 144,496,682 | MEM: 550,657
Evaluating test case: deposit
CPU: 145,521,818 | MEM: 540,207
Evaluating test case: withdraw
CPU: 146,018,200 | MEM: 542,509
O1: 11202 bytes
Evaluating test case: swap_a_for_b
CPU: 128,848,682 | MEM: 452,857
Evaluating test case: swap_b_for_a
CPU: 128,848,682 | MEM: 452,857
Evaluating test case: deposit
CPU: 130,257,818 | MEM: 444,807
Evaluating test case: withdraw
CPU: 130,754,200 | MEM: 447,109
O2: 10756 bytes
Evaluating test case: swap_a_for_b
CPU: 127,479,243 | MEM: 444,891
Evaluating test case: swap_b_for_a
CPU: 127,479,243 | MEM: 444,891
Evaluating test case: deposit
CPU: 129,379,332 | MEM: 439,343
Evaluating test case: withdraw
CPU: 129,843,714 | MEM: 441,445
O3: 4676 bytes
Evaluating test case: swap_a_for_b
CPU: 120,219,315 | MEM: 409,107
Evaluating test case: swap_b_for_a
CPU: 120,219,315 | MEM: 409,107
Evaluating test case: deposit
CPU: 122,119,404 | MEM: 403,559
Evaluating test case: withdraw
CPU: 122,583,786 | MEM: 405,661
Measuring lp_minting_policy...
O0: 56424 bytes
Evaluating test case: mint_one_nft
CPU: 54,068,929 | MEM: 267,073
Evaluating test case: mint_two_nfts
CPU: 71,341,257 | MEM: 317,848
O1: 2768 bytes
Evaluating test case: mint_one_nft
CPU: 28,932,929 | MEM: 109,973
Evaluating test case: mint_two_nfts
CPU: 47,197,257 | MEM: 166,948
O2: 2764 bytes
Evaluating test case: mint_one_nft
CPU: 28,893,686 | MEM: 109,741
Evaluating test case: mint_two_nfts
CPU: 47,118,771 | MEM: 166,484
O3: 1328 bytes
Evaluating test case: mint_one_nft
CPU: 27,501,686 | MEM: 101,041
Evaluating test case: mint_two_nfts
CPU: 45,726,771 | MEM: 157,784
Measuring nft_marketplace_validator...
O0: 57338 bytes
Evaluating test case: buy_one
CPU: 64,707,409 | MEM: 308,335
Evaluating test case: cancel_one
CPU: 55,914,847 | MEM: 288,419
O1: 6078 bytes
Evaluating test case: buy_one
CPU: 42,803,409 | MEM: 171,435
Evaluating test case: cancel_one
CPU: 33,610,847 | MEM: 149,019
O2: 5840 bytes
Evaluating test case: buy_one
CPU: 42,308,923 | MEM: 168,371
Evaluating test case: cancel_one
CPU: 33,123,604 | MEM: 145,987
O3: 2524 bytes
Evaluating test case: buy_one
CPU: 39,413,941 | MEM: 152,675
Evaluating test case: cancel_one
CPU: 29,940,622 | MEM: 128,491
Measuring nft_minting_policy...
O0: 56470 bytes
Evaluating test case: valid_mint
CPU: 54,443,157 | MEM: 276,246
O1: 3198 bytes
Evaluating test case: valid_mint
CPU: 31,067,157 | MEM: 130,146
O2: 3196 bytes
Evaluating test case: valid_mint
CPU: 31,027,914 | MEM: 129,914
O3: 1510 bytes
Evaluating test case: valid_mint
CPU: 28,259,914 | MEM: 112,614
============================================================
BINARY SIZE AND EXECUTION COST COMPARISON REPORT
============================================================
Contract: assert_sum
Description: Simple spending validator with assertion
----------------------------------------
O0: 54,450 → 55,074 bytes (+624 bytes, +1.1%)
Test 'valid_sum': CPU 44,089,759 → 44,217,759 (+128,000, +0.3%) | MEM 239,074 → 239,874 (+800, +0.3%)
O1: 3,440 → 3,816 bytes (+376 bytes, +10.9%) ⚠️ SIGNIFICANT CHANGE (ignored)
Test 'valid_sum': CPU 19,353,759 → 19,721,759 (+368,000, +1.9%) | MEM 84,474 → 86,774 (+2,300, +2.7%)
O2: 3,438 → 3,810 bytes (+372 bytes, +10.8%) ⚠️ SIGNIFICANT CHANGE
Test 'valid_sum': CPU 19,314,516 → 19,682,516 (+368,000, +1.9%) | MEM 84,242 → 86,542 (+2,300, +2.7%)
O3: 1,296 → 1,354 bytes (+58 bytes, +4.5%)
Test 'valid_sum': CPU 17,506,516 → 17,874,516 (+368,000, +2.1%) | MEM 72,942 → 75,242 (+2,300, +3.2%)
Contract: liquidity_pool
Description: Simple DEX pool
----------------------------------------
O0: 151,088 → 151,810 bytes (+722 bytes, +0.5%)
O1: 47,478 → 47,734 bytes (+256 bytes, +0.5%)
O2: 47,144 → 47,468 bytes (+324 bytes, +0.7%)
O3: 18,544 → 18,594 bytes (+50 bytes, +0.3%)
Contract: marketplace
Description: Marketplace contract with complex data structures
----------------------------------------
O0: 123,448 → 124,076 bytes (+628 bytes, +0.5%)
O1: 26,036 → 26,428 bytes (+392 bytes, +1.5%)
O2: 25,940 → 26,332 bytes (+392 bytes, +1.5%)
O3: 4,708 → 4,778 bytes (+70 bytes, +1.5%)
Contract: gift
Description: Gift contract with simple logic
----------------------------------------
O0: 56,918 → 57,642 bytes (+724 bytes, +1.3%)
Test 'valid_withdrawal': CPU 51,588,498 → 52,463,891 (+875,393, +1.7%) | MEM 263,835 → 267,363 (+3,528, +1.3%)
O1: 5,256 → 5,580 bytes (+324 bytes, +6.2%) ⚠️ (ignored)
Test 'valid_withdrawal': CPU 28,276,498 → 29,439,891 (+1,163,393, +4.1%) | MEM 118,135 → 123,463 (+5,328, +4.5%)
O2: 5,252 → 5,574 bytes (+322 bytes, +6.1%) ⚠️
Test 'valid_withdrawal': CPU 28,198,012 → 29,361,405 (+1,163,393, +4.1%) | MEM 117,671 → 122,999 (+5,328, +4.5%)
O3: 1,614 → 1,684 bytes (+70 bytes, +4.3%)
Test 'valid_withdrawal': CPU 25,702,012 → 26,913,405 (+1,211,393, +4.7%) | MEM 102,071 → 107,699 (+5,628, +5.5%) ⚠️
Contract: wrapped_token
Description: Dual-use contract to generate a wrapped token
----------------------------------------
O0: 64,204 → 64,774 bytes (+570 bytes, +0.9%)
O1: 9,186 → 9,516 bytes (+330 bytes, +3.6%)
O2: 8,906 → 9,226 bytes (+320 bytes, +3.6%)
O3: 3,770 → 3,826 bytes (+56 bytes, +1.5%)
Contract: micropayments
Description: Channel for fee-less micropayments
----------------------------------------
O0: 87,178 → 88,246 bytes (+1,068 bytes, +1.2%)
O1: 19,562 → 21,198 bytes (+1,636 bytes, +8.4%) ⚠️ (ignored)
O2: 19,488 → 21,124 bytes (+1,636 bytes, +8.4%) ⚠️
O3: 6,918 → 7,250 bytes (+332 bytes, +4.8%)
Contract: pool_validator
Description: UPLC benchmark DEX pool validator
----------------------------------------
O0: 62,488 → 63,204 bytes (+716 bytes, +1.1%)
Test 'swap_a_for_b': CPU 155,211,202 → 144,496,682 (-10,714,520, -6.9%) | MEM 592,349 → 550,657 (-41,692, -7.0%) ↘️ (costs reduced)
Test 'swap_b_for_a': CPU 155,211,202 → 144,496,682 (-10,714,520, -6.9%) | MEM 592,349 → 550,657 (-41,692, -7.0%) ↘️ (costs reduced)
Test 'deposit': CPU 156,236,338 → 145,521,818 (-10,714,520, -6.9%) | MEM 581,899 → 540,207 (-41,692, -7.2%) ↘️ (costs reduced)
Test 'withdraw': CPU 156,732,720 → 146,018,200 (-10,714,520, -6.8%) | MEM 584,201 → 542,509 (-41,692, -7.1%) ↘️ (costs reduced)
O1: 10,670 → 11,202 bytes (+532 bytes, +5.0%)
Test 'swap_a_for_b': CPU 142,651,202 → 128,848,682 (-13,802,520, -9.7%) | MEM 513,849 → 452,857 (-60,992, -11.9%) ↘️ (costs reduced)
Test 'swap_b_for_a': CPU 142,651,202 → 128,848,682 (-13,802,520, -9.7%) | MEM 513,849 → 452,857 (-60,992, -11.9%) ↘️ (costs reduced)
Test 'deposit': CPU 144,060,338 → 130,257,818 (-13,802,520, -9.6%) | MEM 505,799 → 444,807 (-60,992, -12.1%) ↘️ (costs reduced)
Test 'withdraw': CPU 144,556,720 → 130,754,200 (-13,802,520, -9.5%) | MEM 508,101 → 447,109 (-60,992, -12.0%) ↘️ (costs reduced)
O2: 10,234 → 10,756 bytes (+522 bytes, +5.1%) ⚠️
Test 'swap_a_for_b': CPU 141,203,277 → 127,479,243 (-13,724,034, -9.7%) | MEM 505,419 → 444,891 (-60,528, -12.0%) ↘️ (costs reduced)
Test 'swap_b_for_a': CPU 141,203,277 → 127,479,243 (-13,724,034, -9.7%) | MEM 505,419 → 444,891 (-60,528, -12.0%) ↘️ (costs reduced)
Test 'deposit': CPU 143,103,366 → 129,379,332 (-13,724,034, -9.6%) | MEM 499,871 → 439,343 (-60,528, -12.1%) ↘️ (costs reduced)
Test 'withdraw': CPU 143,567,748 → 129,843,714 (-13,724,034, -9.6%) | MEM 501,973 → 441,445 (-60,528, -12.1%) ↘️ (costs reduced)
O3: 4,724 → 4,676 bytes (-48 bytes, -1.0%) ↘️ (size reduced)
Test 'swap_a_for_b': CPU 136,643,277 → 120,219,315 (-16,423,962, -12.0%) | MEM 476,919 → 409,107 (-67,812, -14.2%) ↘️ (costs reduced)
Test 'swap_b_for_a': CPU 136,643,277 → 120,219,315 (-16,423,962, -12.0%) | MEM 476,919 → 409,107 (-67,812, -14.2%) ↘️ (costs reduced)
Test 'deposit': CPU 138,543,366 → 122,119,404 (-16,423,962, -11.9%) | MEM 471,371 → 403,559 (-67,812, -14.4%) ↘️ (costs reduced)
Test 'withdraw': CPU 139,007,748 → 122,583,786 (-16,423,962, -11.8%) | MEM 473,473 → 405,661 (-67,812, -14.3%) ↘️ (costs reduced)
Contract: lp_minting_policy
Description: UPLC benchmark LP minting policy
----------------------------------------
O0: 56,086 → 56,424 bytes (+338 bytes, +0.6%)
Test 'mint_one_nft': CPU 54,116,929 → 54,068,929 (-48,000, -0.1%) | MEM 267,373 → 267,073 (-300, -0.1%) ↘️ (costs reduced)
Test 'mint_two_nfts': CPU 71,389,257 → 71,341,257 (-48,000, -0.1%) | MEM 318,148 → 317,848 (-300, -0.1%) ↘️ (costs reduced)
O1: 2,682 → 2,768 bytes (+86 bytes, +3.2%)
Test 'mint_one_nft': CPU 28,740,929 → 28,932,929 (+192,000, +0.7%) | MEM 108,773 → 109,973 (+1,200, +1.1%)
Test 'mint_two_nfts': CPU 47,005,257 → 47,197,257 (+192,000, +0.4%) | MEM 165,748 → 166,948 (+1,200, +0.7%)
O2: 2,680 → 2,764 bytes (+84 bytes, +3.1%)
Test 'mint_one_nft': CPU 28,701,686 → 28,893,686 (+192,000, +0.7%) | MEM 108,541 → 109,741 (+1,200, +1.1%)
Test 'mint_two_nfts': CPU 46,926,771 → 47,118,771 (+192,000, +0.4%) | MEM 165,284 → 166,484 (+1,200, +0.7%)
O3: 1,292 → 1,328 bytes (+36 bytes, +2.8%)
Test 'mint_one_nft': CPU 27,309,686 → 27,501,686 (+192,000, +0.7%) | MEM 99,841 → 101,041 (+1,200, +1.2%)
Test 'mint_two_nfts': CPU 45,534,771 → 45,726,771 (+192,000, +0.4%) | MEM 156,584 → 157,784 (+1,200, +0.8%)
Contract: nft_marketplace_validator
Description: UPLC benchmark NFT marketplace validator
----------------------------------------
O0: 57,066 → 57,338 bytes (+272 bytes, +0.5%)
Test 'buy_one': CPU 71,012,598 → 64,707,409 (-6,305,189, -8.9%) | MEM 334,783 → 308,335 (-26,448, -7.9%) ↘️ (costs reduced)
Test 'cancel_one': CPU 62,220,036 → 55,914,847 (-6,305,189, -10.1%) | MEM 314,867 → 288,419 (-26,448, -8.4%) ↘️ (costs reduced)
O1: 6,036 → 6,078 bytes (+42 bytes, +0.7%)
Test 'buy_one': CPU 49,812,598 → 42,803,409 (-7,009,189, -14.1%) | MEM 202,283 → 171,435 (-30,848, -15.2%) ↘️ (costs reduced)
Test 'cancel_one': CPU 40,620,036 → 33,610,847 (-7,009,189, -17.3%) | MEM 179,867 → 149,019 (-30,848, -17.2%) ↘️ (costs reduced)
O2: 5,798 → 5,840 bytes (+42 bytes, +0.7%)
Test 'buy_one': CPU 49,278,869 → 42,308,923 (-6,969,946, -14.1%) | MEM 198,987 → 168,371 (-30,616, -15.4%) ↘️ (costs reduced)
Test 'cancel_one': CPU 40,093,550 → 33,123,604 (-6,969,946, -17.4%) | MEM 176,603 → 145,987 (-30,616, -17.3%) ↘️ (costs reduced)
O3: 2,642 → 2,524 bytes (-118 bytes, -4.5%) ↘️ (size reduced)
Test 'buy_one': CPU 46,878,869 → 39,413,941 (-7,464,928, -15.9%) | MEM 183,987 → 152,675 (-31,312, -17.0%) ↘️ (costs reduced)
Test 'cancel_one': CPU 37,405,550 → 29,940,622 (-7,464,928, -20.0%) | MEM 159,803 → 128,491 (-31,312, -19.6%) ↘️ (costs reduced)
Contract: nft_minting_policy
Description: UPLC benchmark NFT minting policy
----------------------------------------
O0: 56,194 → 56,470 bytes (+276 bytes, +0.5%)
Test 'valid_mint': CPU 54,603,157 → 54,443,157 (-160,000, -0.3%) | MEM 277,246 → 276,246 (-1,000, -0.4%) ↘️ (costs reduced)
O1: 3,180 → 3,198 bytes (+18 bytes, +0.6%)
Test 'valid_mint': CPU 31,035,157 → 31,067,157 (+32,000, +0.1%) | MEM 129,946 → 130,146 (+200, +0.2%)
O2: 3,178 → 3,196 bytes (+18 bytes, +0.6%)
Test 'valid_mint': CPU 30,995,914 → 31,027,914 (+32,000, +0.1%) | MEM 129,714 → 129,914 (+200, +0.2%)
O3: 1,488 → 1,510 bytes (+22 bytes, +1.5%)
Test 'valid_mint': CPU 28,179,914 → 28,259,914 (+80,000, +0.3%) | MEM 112,114 → 112,614 (+500, +0.4%)
Total size change compared to previous release: +14,490 bytes
⚠️ SIGNIFICANT CHANGES DETECTED
Please review the changes and consider optimization if sizes or costs increased significantly.
============================================================
Please review the binary size changes. Significant increases may impact contract deployment costs and execution limits.
This report compares the binary sizes of compiled contracts against the baseline from the latest release.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tackles #557