Skip to content

Contract deployment fails on qanet/preview but succeeds on undeployed [Blocking QA Tests] #1150

@adamreynolds-io

Description

@adamreynolds-io

Context & versions

Contract deployment fails on deployed environments (qanet, preview) with a generic error that is not helpful to understand why the transaction is invalid.

Target environments:

  • FAIL: old qanet + preview - node-0.20.2 (compact 0.29.0 and 0.28.0-rc.0)
  • FAIL: new qanet - node-0.21.0-rc.3 (compact 0.29.0 and 0.28.0-rc.0)
  • PASS: undeployed - node-0.20.2 (compact 0.29.0)

Steps to reproduce

  1. Compile the contract below using midnight.js (latest released version)
  2. Deploy the contract using midnight.js
  3. Observe failure on deployed envs, success on undeployed

Contract source code:

import CompactStandardLibrary;

export ledger test_set: Set<Field>;
export ledger test_map: Map<Field, Field>;
export ledger test_list: List<Field>;
export ledger operation_count: Uint<64>;

export circuit test_adt_threshold_100(): Boolean {
    test_set.resetToDefault();
    test_map.resetToDefault();
    test_list.resetToDefault();

    // 100 operations - should compile and generate proof successfully
    for(const i of 0..99) {
        test_set.insert(i);
        test_map.insert(i, i * 2);
        test_list.pushFront(i);
    }

    const results_valid = (test_set.size() == 100) &&
                         (test_map.size() == 100) &&
                         (test_list.length() == 100);

    operation_count = 100;
    return results_valid;
}

Actual behavior

[09:52:14.307] INFO (1919947): Deploying contract...
2026-02-20 09:52:15        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Custom error: 139
[11:06:27.265] ERROR (2215039): Deployment failed

Note: Deploying and calling this contract is vital to test core component stability as this is a load test from a language perspective. It originally made the indexer crash, forcing a stack size increase.

Expected behavior

Contract deployment should succeed on all environments consistently, as it does on undeployed.


Migrated from PM-21970

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions