Skip to content

Proposal Procedures dropped from script context during evaluation #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nielstron opened this issue Apr 24, 2025 · 2 comments
Open

Proposal Procedures dropped from script context during evaluation #438

nielstron opened this issue Apr 24, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@nielstron
Copy link
Contributor

Describe the bug
I am trying to extract the script context from a script invocation in PlutusV3 including Proposal Procedures. However, using the script I wrote for this purpose, the log indicates that the proposal procedure is not included correctly in the script context during evaluation. Closer investigation revealed that deepcopy on the NonEmptyOrderedSet of proposal procedures appears to return an empty set.

I was able to resolve this by adding the following method to NonEmptyOrderedSet (however am now faced with "invalid reward address header"):

    def __deepcopy__(self, memodict={}):
        return NonEmptyOrderedSet(deepcopy(list(x for x in self)))

To Reproduce
The following script always tries to unroll the script context parameter, raising an error in ogmios that dumps the script context

{"type": "PlutusScriptV3", "description": "", "cborHex": "58a458a20100003232232323232323374a90001bb1498c8d4008400401448c8c92610013330063758a00246eb400452f580264c66ae712410c4e616d654572726f723a207a004984c98cd5ce2481144e616d654572726f723a2076616c696461746f72004984c98cd5ce24810d4e616d654572726f723a20723300498888cc8c014894ccd55cf8008a802099aba0300335742002660040046ae8800400800c8c8c0040040041"}

script.cbor

58a20100003232232323232323374a90001bb1498c8d4008400401448c8c92610013330063758a00246eb400452f580264c66ae712410c4e616d654572726f723a207a004984c98cd5ce2481144e616d654572726f723a2076616c696461746f72004984c98cd5ce24810d4e616d654572726f723a20723300498888cc8c014894ccd55cf8008a802099aba0300335742002660040046ae8800400800c8c8c0040040041

It has following address:

addr_test1wpq4ft6y2tzhj5dq6n5ml5mwlqyuday7mznxjel9rj7ux9qqlmqnw
  1. Check out the opshin pioneer program: https://github.com/OpShin/opshin-pioneer-program
  2. Build week 2 and override the gift contract address and script cbor with the above script
  3. Use make gift to deposit funds at the address: https://github.com/OpShin/opshin-pioneer-program/blob/main/src/week02/scripts/make_gift.py
  4. Use this modified collect_gift to retrieve the script context. note the deposit integer does not appear anywhere in the logged error
# collect_gift.py
import click
import pycardano
from pycardano import (
    Address,
    TransactionBuilder,
    UTxO,
    PlutusV3Script,
    plutus_script_hash,
    Redeemer, AssetName, MultiAsset, Asset, Voter, VoterType, GovActionId, Anchor, Vote, GovAction,
    ParameterChangeAction, InfoAction, ProtocolParamUpdate
)

from src.utils import get_address, get_signing_info, network, get_chain_context
from src.utils.network import show_tx
from src.week02 import assets_dir


@click.command()
@click.argument("name")
@click.option(
    "--script",
    type=click.Choice(
        ["burn", "custom_types", "fourty_two", "fourty_two_typed", "gift"]
    ),
    default="gift",
    help="Which lecture script address to attempt to spend.",
)
def main(name: str, script: str):
    """
    Obtain deposited funds (using make_gift) from a smart contract
    """
    # Load chain context
    context = get_chain_context()

    # Load script info
    # We need `plutus_script: PlutusV2Script` and `script_address: Address`.
    # There are multiple ways to get there but the simplest is to use "script.cbor"
    with open(assets_dir.joinpath(script, "script.cbor"), "r") as f:
        cbor_hex = f.read()

    cbor = bytes.fromhex(cbor_hex)

    # with open(assets_dir.joinpath(script, "script.plutus"), "r") as f:
    #     script_plutus = json.load(f)
    #     script_hex = script_plutus["cborHex"]
    # cbor_wrapped = cbor2.dumps(cbor)
    # cbor_wrapped_hex = cbor_wrapped.hex()
    # assert script_hex == cbor_wrapped_hex

    plutus_script = PlutusV3Script(cbor)
    script_hash = plutus_script_hash(plutus_script)
    script_address = Address(script_hash, network=network)

    # with open(assets_dir.joinpath(script, "testnet.addr")) as f:
    #     addr = Address.from_primitive(f.read())
    #     assert script_address == addr

    # Get payment address
    payment_address = get_address(name)

    # Find a script UTxO
    utxo_to_spend = None
    for utxo in context.utxos(script_address):
        if utxo.output.datum:
            utxo_to_spend = utxo
            break
    assert isinstance(utxo_to_spend, UTxO), f"No script UTxOs found! Execute make gift with --script {script} to deposit funds at the address."

    # Build the transaction
    # no output is specified since everything minus fees is sent to change address
    from src.week02.lecture.custom_types import MySillyRedeemer
    if script in ["fourty_two", "fourty_two_typed"]:
        redeemer = Redeemer(42)
    elif script == "custom_types":
        from src.week02.lecture.custom_types import MySillyRedeemer

        redeemer = Redeemer(MySillyRedeemer(42))
    else:
        redeemer = Redeemer(0)
    builder = TransactionBuilder(context)
    builder.add_script_input(utxo_to_spend, script=plutus_script, redeemer=redeemer)
    builder.ttl = context.last_block_slot + 10

    # Sign the transaction
    payment_vkey, payment_skey, payment_address = get_signing_info(name)
    builder.add_proposal(
        deposit=1234122,
        reward_account=payment_vkey.hash().payload,
        gov_action=ParameterChangeAction(
            gov_action_id=GovActionId(gov_action_index=0, transaction_id=utxo_to_spend.input.transaction_id),
            protocol_param_update=ProtocolParamUpdate(
                min_fee_b=1000,
            ),
            policy_hash=None,
        ),
        anchor = None
    )
    # TODO: deepcopy somehow removes the proposals, breaking this -> can fix by implementing __deepcopy__ in nonemptyorderedset
    print(builder.proposal_procedures)
    signed_tx = builder.build_and_sign(
        signing_keys=[payment_skey],
        change_address=payment_address,
    )

    # Submit the transaction
    context.submit_tx(signed_tx)

    show_tx(signed_tx)


if __name__ == "__main__":
    main()

Logs

$ python3 src/week02/scripts/collect_gift.py niels
NonEmptyOrderedSet([{
  'anchor': None,
  'deposit': 1234122,
  'gov_action': {
    'gov_action_id': {
      'gov_action_index': 0,
      'transaction_id': TransactionId(hex='ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5'),
    },
    'policy_hash': None,
    'protocol_param_update': {
      'ada_per_utxo_byte': None,
      'collateral_percentage': None,
      'committee_term_limit': None,
      'cost_models': None,
      'drep_deposit': None,
      'drep_inactivity_period': None,
      'drep_voting_thresholds': None,
      'execution_costs': None,
      'expansion_rate': None,
      'governance_action_deposit': None,
      'governance_action_validity_period': None,
      'key_deposit': None,
      'max_block_body_size': None,
      'max_block_ex_units': None,
      'max_block_header_size': None,
      'max_collateral_inputs': None,
      'max_transaction_size': None,
      'max_tx_ex_units': None,
      'max_value_size': None,
      'maximum_epoch': None,
      'min_committee_size': None,
      'min_fee_a': None,
      'min_fee_b': 1000,
      'min_fee_ref_script_cost': None,
      'min_pool_cost': None,
      'n_opt': None,
      'pool_deposit': None,
      'pool_pledge_influence': None,
      'pool_voting_thresholds': None,
      'treasury_growth_rate': None,
    },
  },
  'reward_account': b'a)\x94X\xbdm0\x11f\x9a\xc53\xb5 \xab\x07\xb9Mt(\x90?aqK\xab\xb5\x82',
}])
2025-04-24 23:00:46,020 - PyCardano - WARNING - Class: <class 'pycardano.txbuilder.TransactionBuilder'>, method: <function TransactionBuilder.build at 0x111cb4680>, state:
 {
  '_certificate_script_to_redeemers': [],
  '_collateral_return': {
    'address': addr_test1vpsjn9zch4knqytxntzn8dfq4vrmjnt59zgr7ct3fw4mtqsndwn90,
    'amount': {'coin': 983727741, 'multi_asset': {}},
    'datum': None,
    'datum_hash': None,
    'post_alonzo': False,
    'script': None,
  },
  '_datums': {},
  '_excluded_inputs': [],
  '_input_addresses': [],
  '_inputs': [
    {'input': {
      'index': 0,
      'transaction_id': TransactionId(hex='ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5'),
    },
     'output': {
      'address': addr_test1wpq4ft6y2tzhj5dq6n5ml5mwlqyuday7mznxjel9rj7ux9qqlmqnw,
      'amount': {'coin': 3000000, 'multi_asset': {}},
      'datum': RawCBOR(cbor=b'\xd8y\x80'),
      'datum_hash': None,
      'post_alonzo': False,
      'script': None,
    }},
  ],
  '_inputs_to_redeemers': {
    {'input': {
      'index': 0,
      'transaction_id': TransactionId(hex='ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5'),
    },
     'output': {
      'address': addr_test1wpq4ft6y2tzhj5dq6n5ml5mwlqyuday7mznxjel9rj7ux9qqlmqnw,
      'amount': {'coin': 3000000, 'multi_asset': {}},
      'datum': RawCBOR(cbor=b'\xd8y\x80'),
      'datum_hash': None,
      'post_alonzo': False,
      'script': None,
    }}: {
      'data': 0,
      'ex_units': {'mem': 0, 'steps': 0},
      'index': 0,
      'tag': {
        '__objclass__': <enum 'RedeemerTag'>,
        '_name_': 'SPEND',
        '_sort_order_': 0,
        '_value_': 0,
      },
    },
  },
  '_inputs_to_scripts': {
    {'input': {
      'index': 0,
      'transaction_id': TransactionId(hex='ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5'),
    },
     'output': {
      'address': addr_test1wpq4ft6y2tzhj5dq6n5ml5mwlqyuday7mznxjel9rj7ux9qqlmqnw,
      'amount': {'coin': 3000000, 'multi_asset': {}},
      'datum': RawCBOR(cbor=b'\xd8y\x80'),
      'datum_hash': None,
      'post_alonzo': False,
      'script': None,
    }}: b'X\xa2\x01\x00\x0022######7J\x90\x00\x1b\xb1I\x8c\x8d@\x08@\x04\x01D\x8c\x8c\x92a\x00\x133\x00cu\x8a\x00$n\xb4\x00E/X\x02d\xc6j\xe7\x12A\x0cNameError: z\x00I\x84\xc9\x8c\xd5\xce$\x81\x14NameError: validator\x00I\x84\xc9\x8c\xd5\xce$\x81\rNameError: r3\x00I\x88\x88\xcc\x8c\x01H\x94\xcc\xd5\\\xf8\x00\x8a\x80 \x99\xab\xa00\x035t \x02f\x00@\x04j\xe8\x80\x04\x00\x80\x0c\x8c\x8c\x00@\x04\x00A',
  },
  '_minting_script_to_redeemers': [],
  '_outputs': [],
  '_potential_inputs': [],
  '_reference_scripts': [],
  '_should_estimate_execution_units': False,
  '_total_collateral': 3607615,
  '_withdrawal_script_to_redeemers': [],
  'auxiliary_data': None,
  'certificates': None,
  'collateral_return_threshold': 1000000,
  'collaterals': [
    {'input': {
      'index': 1,
      'transaction_id': TransactionId(hex='ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5'),
    },
     'output': {
      'address': addr_test1vpsjn9zch4knqytxntzn8dfq4vrmjnt59zgr7ct3fw4mtqsndwn90,
      'amount': {'coin': 987335356, 'multi_asset': {}},
      'datum': None,
      'datum_hash': None,
      'post_alonzo': False,
      'script': None,
    }},
  ],
  'context': <pycardano.backend.ogmios_v6.OgmiosChainContext object at 0x11245f310>,
  'execution_memory_buffer': 0.2,
  'execution_step_buffer': 0.2,
  'fee_buffer': None,
  'initial_stake_pool_registration': False,
  'mint': None,
  'native_scripts': None,
  'proposal_procedures': NonEmptyOrderedSet([{
    'anchor': None,
    'deposit': 1234122,
    'gov_action': {
      'gov_action_id': {
        'gov_action_index': 0,
        'transaction_id': TransactionId(hex='ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5'),
      },
      'policy_hash': None,
      'protocol_param_update': {
        'ada_per_utxo_byte': None,
        'collateral_percentage': None,
        'committee_term_limit': None,
        'cost_models': None,
        'drep_deposit': None,
        'drep_inactivity_period': None,
        'drep_voting_thresholds': None,
        'execution_costs': None,
        'expansion_rate': None,
        'governance_action_deposit': None,
        'governance_action_validity_period': None,
        'key_deposit': None,
        'max_block_body_size': None,
        'max_block_ex_units': None,
        'max_block_header_size': None,
        'max_collateral_inputs': None,
        'max_transaction_size': None,
        'max_tx_ex_units': None,
        'max_value_size': None,
        'maximum_epoch': None,
        'min_committee_size': None,
        'min_fee_a': None,
        'min_fee_b': 1000,
        'min_fee_ref_script_cost': None,
        'min_pool_cost': None,
        'n_opt': None,
        'pool_deposit': None,
        'pool_pledge_influence': None,
        'pool_voting_thresholds': None,
        'treasury_growth_rate': None,
      },
    },
    'reward_account': b'a)\x94X\xbdm0\x11f\x9a\xc53\xb5 \xab\x07\xb9Mt(\x90?aqK\xab\xb5\x82',
  }]),
  'reference_inputs': set(),
  'required_signers': [],
  'ttl': 4953,
  'use_redeemer_map': True,
  'utxo_selectors': [
    <pycardano.coinselection.RandomImproveMultiAsset object at 0x112485450>,
    <pycardano.coinselection.LargestFirstSelector object at 0x1124854d0>,
  ],
  'validity_start': 3943,
  'withdrawals': None,
  'witness_override': None,
}
Traceback (most recent call last):
  File "/Users/niels/git/opshin-pioneer-program/src/week02/scripts/collect_gift.py", line 112, in <module>
    main()
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/git/opshin-pioneer-program/src/week02/scripts/collect_gift.py", line 100, in main
    signed_tx = builder.build_and_sign(
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/txbuilder.py", line 1688, in build_and_sign
    tx_body = self.build(
              ^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/logging.py", line 37, in wrapper
    raise e
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/logging.py", line 28, in wrapper
    output = func(obj, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/txbuilder.py", line 1455, in build
    self._update_execution_units(
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/txbuilder.py", line 1592, in _update_execution_units
    estimated_execution_units = self._estimate_execution_units(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/txbuilder.py", line 1639, in _estimate_execution_units
    return self.context.evaluate_tx(tx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/backend/base.py", line 209, in evaluate_tx
    return self.evaluate_tx_cbor(tx.to_cbor())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/pycardano/backend/ogmios_v6.py", line 329, in evaluate_tx_cbor
    result, _ = client.evaluate_transaction.execute(cbor)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/ogmios/txsubmit/EvaluateTransaction.py", line 49, in execute
    return self.receive()
           ^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/ogmios/txsubmit/EvaluateTransaction.py", line 81, in receive
    return self._parse_EvaluateTransaction_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/niels/miniconda3/envs/opshin-pioneer-program/lib/python3.11/site-packages/ogmios/txsubmit/EvaluateTransaction.py", line 93, in _parse_EvaluateTransaction_response
    raise ResponseError(f"Ogmios responded with error: {response}")
ogmios.errors.ResponseError: Ogmios responded with error: {'jsonrpc': '2.0', 'method': 'evaluateTransaction', 'error': {'code': 3010, 'message': 'Some scripts of the transactions terminated with error(s).', 'data': [{'validator': {'index': 0, 'purpose': 'spend'}, 'error': {'code': 3012, 'message': "Some of the scripts failed to evaluate to a positive outcome. The field 'data.validationError' informs about the nature of the error, and 'data.traces' lists all the execution traces collected during the script execution.", 'data': {'validationError': "An error has occurred:\nThe machine terminated because of an error, either from a built-in function or from an explicit use of 'error'.\nCaused by: [\n  (builtin unListData)\n  (con\n    data\n    (Constr 0\n       [ Constr 0\n           [ List\n               [ Constr 0\n                   [ Constr 0\n                       [ B #ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5\n                       , I 0 ]\n                   , Constr 0\n                       [ Constr 0\n                           [ Constr 1\n                               [ B #4154af4452c57951a0d4e9bfd36ef809c6f49ed8a66967e51cbdc314 ]\n                           , Constr 1 [] ]\n                       , Map [(B #, Map [(B #, I 3000000)])]\n                       , Constr 2 [Constr 0 []]\n                       , Constr 1 [] ] ] ]\n           , List []\n           , List\n               [ Constr 0\n                   [ Constr 0\n                       [ Constr 0\n                           [ B #61299458bd6d3011669ac533b520ab07b94d7428903f61714babb582 ]\n                       , Constr 1 [] ]\n                   , Map [(B #, Map [(B #, I 2822355)])]\n                   , Constr 0 []\n                   , Constr 1 [] ] ]\n           , I 177645\n           , Map []\n           , List []\n           , Map []\n           , Constr 0\n               [ Constr 0 [Constr 1 [I 1745503135000], Constr 1 []]\n               , Constr 0 [Constr 1 [I 1745504145000], Constr 0 []] ]\n           , List []\n           , Map\n               [ ( Constr 1\n                     [ Constr 0\n                         [ B #ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5\n                         , I 0 ] ]\n               , I 0 ) ]\n           , Map []\n           , B #570253ea0d1811d46f151ae877f9d988d27c8409b1600cc2924563976d7bdab9\n           , Map []\n           , List []\n           , Constr 1 []\n           , Constr 1 [] ]\n       , I 0\n       , Constr 1\n           [ Constr 0\n               [ B #ec7874002d9b55a81e64eefcb3b41f8897eb36ad61c3392661f8a7c5a39879a5\n               , I 0 ]\n           , Constr 0 [Constr 0 []] ] ])\n  )\n]", 'traces': ['Expected the List constructor but got a different one']}}}]}, 'id': None}

Expected behavior
Should include the proposal procedures in the script context

Environment and software version (please complete the following information):

  • OS: MacOS on a custom devnet (yaci)
  • PyCardano Version: 0.13.2
@cffls cffls added the bug Something isn't working label Apr 26, 2025
@cffls
Copy link
Collaborator

cffls commented Apr 30, 2025

Thanks @nielstron for reporting this issue. The deepcopy seems to be the main reason why the proposal was included in the script context. After adding deepcopy, the values provided in the proposal showed up in the message of unroll script. Also, notice how the reward account is added differently from your example above. This is required in order for the script context to be successfully unrolled. I added an integration test to make sure it actually happened here.
However, one last thing is that Anchor info is still missing in Ogmios error message (attached below). Is it because it hasn't been implemented in the script itself?

[
  (builtin unListData)
  (con
    data
    (Constr 0
       [ Constr 0
           [ List
               [ Constr 0
                   [ Constr 0
                       [ B #30324607ff548fd966c4a33dc0aaef58bc72d911d19ec1688be84810fc4ac341
                       , I 0 ]
                   , Constr 0
                       [ Constr 0
                           [ Constr 1
                               [ B #4154af4452c57951a0d4e9bfd36ef809c6f49ed8a66967e51cbdc314 ]
                           , Constr 1 [] ]
                       , Map [(B #, Map [(B #, I 50000000)])]
                       , Constr 2 [Constr 0 []]
                       , Constr 1 [] ] ] ]
           , List []
           , List
               [ Constr 0
                   [ Constr 0
                       [ Constr 0
                           [ B #d413c1745d306023e49589e658a7b7a4b4dda165ff5c97d8c8b979bf ]
                       , Constr 1 [] ]
                   , Map [(B #, Map [(B #, I 48569225)])]
                   , Constr 0 []
                   , Constr 1 [] ] ]
           , I 196653
           , Map []
           , List []
           , Map []
           , Constr 0
               [ Constr 0 [Constr 1 [I 1745963814000], Constr 1 []]
               , Constr 0 [Constr 1 [I 1745964824000], Constr 0 []] ]
           , List []
           , Map
               [ ( Constr 1
                     [ Constr 0
                         [ B #30324607ff548fd966c4a33dc0aaef58bc72d911d19ec1688be84810fc4ac341
                         , I 0 ] ]
               , I 0 ) ]
           , Map []
           , B #20882375f69b4c53b05ee58fc763bedaa8dbf5238e750504082f40aa0aad3267
           , Map []
           , List
               [ Constr 0
                   [ I 1234122
                   , Constr 0
                       [ B #87f26967b09409ad8b9cb593720a84130f877f3c802f551409fdcb42 ]
                   , Constr 0
                       [ Constr 0
                           [ Constr 0
                               [ B #30324607ff548fd966c4a33dc0aaef58bc72d911d19ec1688be84810fc4ac341
                               , I 0 ] ]
                       , Map [(I 1, I 1000)]
                       , Constr 1 [] ] ] ]
           , Constr 1 []
           , Constr 1 [] ]
       , I 0
       , Constr 1
           [ Constr 0
               [ B #30324607ff548fd966c4a33dc0aaef58bc72d911d19ec1688be84810fc4ac341
               , I 0 ]
           , Constr 0 [Constr 0 []] ] ])
  )
]", 'traces': ['Expected the List constructor but got a different one']}}}]

For the context, here is one of the cbors passed to Ogmios for evaluation:

84aa00d901028182582021f818063a9dea565d1cb17b9f667d5c16bf7c9f50628eecad6307e07cd7be6600018182581d60d413c1745d306023e49589e658a7b7a4b4dda165ff5c97d8c8b979bf1a02e51b31021a00030085031a000101dd0819fdeb0b58204792c4b6661ae6953281da458246b3c8b683e6e55c64ede620b1c20a9dd4243a0dd9010281825820624112ab22f20e3ba84f1a823d049a264abeaf36fe4e1691e3748e5e8a052798011082581d60d413c1745d306023e49589e658a7b7a4b4dda165ff5c97d8c8b979bf821b0000003a4581ddc9a5581c62bdc3d04d04376d516d31664944b25ce3affa76d17f8b5e1279b49da24f4d595f5343524950545f4e46545f31024f4d595f5343524950545f4e46545f3202581c7c8736fbf9e60bd82391dc8623871d6c130f634d0ed93e5a9b3cf6e2a2484d595f4e46545f3101484d595f4e46545f3201581ca0331235b9daf24527e7315b8e1aef8eab1435f88123e3731a55cc7aa2484d595f4e46545f3101484d595f4e46545f3201581cacd3fec8cd9a185a8ca27434adac5274b5a70601f40a2d8c896931ada24f4d595f5343524950545f4e46545f31014f4d595f5343524950545f4e46545f3201581ccde53011eddd8f8e9b09ab92e67ad7a8a9085543e2613a3e8c2ac741a2484d595f4e46545f3101484d595f4e46545f3201111a0031c3e714d9010281841a0012d4ca581de080094e1f7f06ee63a929b002ce1d7996ffcf0de6e47a19caf137d3a8840082582021f818063a9dea565d1cb17b9f667d5c16bf7c9f50628eecad6307e07cd7be6600a1011903e8f6827568747470733a2f2f746573742d647265702e636f6d58200000000000000000000000000000000000000000000000000000000000000000a300d9010281825820000000000000000000000000000000000000000000000000000000000000000058400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005a1820000820082000007d901028158a458a20100003232232323232323374a90001bb1498c8d4008400401448c8c92610013330063758a00246eb400452f580264c66ae712410c4e616d654572726f723a207a004984c98cd5ce2481144e616d654572726f723a2076616c696461746f72004984c98cd5ce24810d4e616d654572726f723a20723300498888cc8c014894ccd55cf8008a802099aba0300335742002660040046ae8800400800c8c8c0040040041f5f6

and it certainly contains Anchor info:

echo 84aa00d901028182582021f818063a9dea565d1cb17b9f667d5c16bf7c9f50628eecad6307e07cd7be6600018182581d60d413c1745d306023e49589e658a7b7a4b4dda165ff5c97d8c8b979bf1a02e51b31021a00030085031a000101dd0819fdeb0b58204792c4b6661ae6953281da458246b3c8b683e6e55c64ede620b1c20a9dd4243a0dd9010281825820624112ab22f20e3ba84f1a823d049a264abeaf36fe4e1691e3748e5e8a052798011082581d60d413c1745d306023e49589e658a7b7a4b4dda165ff5c97d8c8b979bf821b0000003a4581ddc9a5581c62bdc3d04d04376d516d31664944b25ce3affa76d17f8b5e1279b49da24f4d595f5343524950545f4e46545f31024f4d595f5343524950545f4e46545f3202581c7c8736fbf9e60bd82391dc8623871d6c130f634d0ed93e5a9b3cf6e2a2484d595f4e46545f3101484d595f4e46545f3201581ca0331235b9daf24527e7315b8e1aef8eab1435f88123e3731a55cc7aa2484d595f4e46545f3101484d595f4e46545f3201581cacd3fec8cd9a185a8ca27434adac5274b5a70601f40a2d8c896931ada24f4d595f5343524950545f4e46545f31014f4d595f5343524950545f4e46545f3201581ccde53011eddd8f8e9b09ab92e67ad7a8a9085543e2613a3e8c2ac741a2484d595f4e46545f3101484d595f4e46545f3201111a0031c3e714d9010281841a0012d4ca581de080094e1f7f06ee63a929b002ce1d7996ffcf0de6e47a19caf137d3a8840082582021f818063a9dea565d1cb17b9f667d5c16bf7c9f50628eecad6307e07cd7be6600a1011903e8f6827568747470733a2f2f746573742d647265702e636f6d58200000000000000000000000000000000000000000000000000000000000000000a300d9010281825820000000000000000000000000000000000000000000000000000000000000000058400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005a1820000820082000007d901028158a458a20100003232232323232323374a90001bb1498c8d4008400401448c8c92610013330063758a00246eb400452f580264c66ae712410c4e616d654572726f723a207a004984c98cd5ce2481144e616d654572726f723a2076616c696461746f72004984c98cd5ce24810d4e616d654572726f723a20723300498888cc8c014894ccd55cf8008a802099aba0300335742002660040046ae8800400800c8c8c0040040041f5f6 | xxd -r -p | base64 | poetry run python3 -m cbor2.tool -d | jq
[
  {
    "0": [
      [
        "!\\xf8\u0018\u0006:\\x9d\\xeaV]\u001c\\xb1{\\x9ff}\\\u0016\\xbf|\\x9fPb\\x8e\\xec\\xadc\u0007\\xe0|׾f",
        0
      ]
    ],
    "1": [
      [
        "`\\xd4\u0013\\xc1t]0`#䕉\\xe6X\\xa7\\xb7\\xa4\\xb4ݡe\\xff\\\\x97\\xd8ȹy\\xbf",
        48569137
      ]
    ],
    "2": 196741,
    "3": 66013,
    "8": 65003,
    "11": "G\\x92Ķf\u001a\\xe6\\x952\\x81\\xdaE\\x82F\\xb3ȶ\\x83\\xe6\\xe5\\d\\xed\\xe6 \\xb1\\xc2\n\\x9d\\xd4$:",
    "13": [
      [
        "bA\u0012\\xab\"\\xf2\u000e;\\xa8O\u001a\\x82=\u0004\\x9a&J\\xbe\\xaf6\\xfeN\u0016\\x91\\xe3t\\x8e^\\x8a\u0005'\\x98",
        1
      ]
    ],
    "16": [
      "`\\xd4\u0013\\xc1t]0`#䕉\\xe6X\\xa7\\xb7\\xa4\\xb4ݡe\\xff\\\\x97\\xd8ȹy\\xbf",
      [
        250274241993,
        {
          "b\\xbd\\xc3\\xd0M\u00047mQm1fID\\xb2\\\\xe3\\xaf\\xfav\\xd1\u007f\\x8b^\u0012y\\xb4\\x9d": {
            "MY_SCRIPT_NFT_1": 2,
            "MY_SCRIPT_NFT_2": 2
          },
          "|\\x876\\xfb\\xf9\\xe6\u000b\\xd8#\\x91܆#\\x87\u001dl\u0013\u000fcM\u000e\\xd9>Z\\x9b<\\xf6\\xe2": {
            "MY_NFT_1": 1,
            "MY_NFT_2": 1
          },
          "\\xa03\u00125\\xb9\\xda\\xf2E'\\xe71[\\x8e\u001a\u00145\\xf8\\x81#\\xe3s\u001aU\\xccz": {
            "MY_NFT_1": 1,
            "MY_NFT_2": 1
          },
          "\\xac\\xd3\\xfe\\xc8͚\u0018Z\\x8c\\xa2t4\\xad\\xacRt\\xb5\\xa7\u0006\u0001\\xf4\n-\\x8c\\x89i1\\xad": {
            "MY_SCRIPT_NFT_1": 1,
            "MY_SCRIPT_NFT_2": 1
          },
          "\\xcd\\xe50\u0011\\xedݏ\\x8e\\x9b\t\\xab\\x92\\xe6zר\\xa9\bUC\\xe2a:>\\x8c*\\xc7A": {
            "MY_NFT_1": 1,
            "MY_NFT_2": 1
          }
        }
      ]
    ],
    "17": 3261415,
    "20": [
      [
        1234122,
        "\\xe0\\x80\tN\u001f\u007f\u0006\\xeec\\xa9)\\xb0\u0002\\xce\u001dy\\x96\\xff\\xcf\r\\xe6\\xe4z\u0019\\xca\\xf17Ө",
        [
          0,
          [
            "!\\xf8\u0018\u0006:\\x9d\\xeaV]\u001c\\xb1{\\x9ff}\\\u0016\\xbf|\\x9fPb\\x8e\\xec\\xadc\u0007\\xe0|׾f",
            0
          ],
          "{1: 1000}",
          null
        ],
        [
          "https://test-drep.com",
          "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
        ]
      ]
    ]
  },
  {
    "0": [
      [
        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
      ]
    ],
    "5": {
      "(0, 0)": [
        0,
        [
          0,
          0
        ]
      ]
    },
    "7": [
      "X\\xa2\u0001\u0000\u000022######7J\\x90\u0000\u001b\\xb1I\\x8c\\x8d@\b@\u0004\u0001D\\x8c\\x8c\\x92a\u0000\u00133\u0000cu\\x8a\u0000$n\\xb4\u0000E/X\u0002d\\xc6j\\xe7\u0012A\fNameError: z\u0000I\\x84Ɍ\\xd5\\xce$\\x81\u0014NameError: validator\u0000I\\x84Ɍ\\xd5\\xce$\\x81\rNameError: r3\u0000I\\x88\\x88̌\u0001H\\x94\\xcc\\xd5\\\\xf8\u0000\\x8a\\x80 \\x99\\xab\\xa00\u00035t \u0002f\u0000@\u0004j\\xe8\\x80\u0004\u0000\\x80\f\\x8c\\x8c\u0000@\u0004\u0000A"
    ]
  },
  true,
  null
]

@cffls
Copy link
Collaborator

cffls commented May 3, 2025

Is there any remaining issue with the fix, or is it good to close this now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants