Skip to content

New/Upgraded Module

The micro service ms-new-modules has a subscription to the MQTT channel heartbeat/module/new and starts processing when a new message arrives. The message contains the module_ref.

Steps

Metadata

In this step, the service will ask the node (GetModuleSource) for the WebAssembly source bytes and parse this with a WebAssembly Decoder. If this succeeds, it will proceed to extract the method names from the source bytes.

Verification

The final step is veryfying a module. To capture this, we’ve added a verification object:

ModuleVerification represents the verification details of a module.

Attributes:

Name Type Description
verified Optional[bool]

Indicates if the module is verified. Defaults to False.

verification_status str

The status of the verification process.

verification_timestamp Optional[datetime]

The timestamp when the verification was performed. Defaults to None.

explanation Optional[str]

An optional explanation of the verification status. Defaults to None.

build_image_used Optional[str]

The build image used during verification. Defaults to None.

build_command_used Optional[str]

The build command used during verification. Defaults to None.

archive_hash Optional[str]

The hash of the archive used during verification. Defaults to None.

link_to_source_code Optional[str]

A link to the source code of the module. Defaults to None.

source_code_at_verification_time Optional[str]

The source code at the time of verification. Defaults to None.

Source code in .venv/lib/python3.13/site-packages/ccdexplorer/domain/mongo.py
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
class ModuleVerification(BaseModel):
    """
    ModuleVerification represents the verification details of a module.

    Attributes:
        verified (Optional[bool]): Indicates if the module is verified. Defaults to False.
        verification_status (str): The status of the verification process.
        verification_timestamp (Optional[dt.datetime]): The timestamp when the verification was performed. Defaults to None.
        explanation (Optional[str]): An optional explanation of the verification status. Defaults to None.
        build_image_used (Optional[str]): The build image used during verification. Defaults to None.
        build_command_used (Optional[str]): The build command used during verification. Defaults to None.
        archive_hash (Optional[str]): The hash of the archive used during verification. Defaults to None.
        link_to_source_code (Optional[str]): A link to the source code of the module. Defaults to None.
        source_code_at_verification_time (Optional[str]): The source code at the time of verification. Defaults to None.
    """

    verified: Optional[bool] = False
    verification_status: str
    verification_timestamp: Optional[dt.datetime] = None
    explanation: Optional[str] = None
    build_image_used: Optional[str] = None
    build_command_used: Optional[str] = None
    archive_hash: Optional[str] = None
    link_to_source_code: Optional[str] = None
    source_code_at_verification_time: Optional[str] = None

Dockerfile

To facilitate the verification process, both Concordium-client and cargo Concordium (and Rust) are included in the Dockerfile.

Verification Steps

  1. Save the module to disk. Command: module show module_ref —-out tmp/filename.out
  2. Print build info: Command: cargo concordium print-build-info —-module tmp/filename.out
  3. Retrieve source from url. Use httpx to download contents from url.
  4. Unpack downloaded tar file to disk (module_path)
  5. Start verification process. Command: cargo concordium verify-build —-module module_path
  6. Store verification results in modules collection

Result

The result of the verification process is shown on the module page in the Explorer.