Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Latest commit

 

History

History

contracts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Validator Contracts

The Solidity source for the two on-chain contracts that govern the DSV validator set. These complete the validator side of the protocol and were not part of the earlier published Powerloom protocol-contracts repository (which carries ProtocolState, DataMarket, and the rest of the core set).

Contract File Role
PowerloomValidatorNodes ValidatorState.sol Validator node registry. Mints/burns nodes as non-transferable (soulbound) ERC-1155 tokens; manages owner/validator/signer roles; resolves signerToNodeId; handles burn + token claim.
ValidatorPriorityAssigner ValidatorPriorityAssigner.sol Per-epoch validator priority assignment (the on-chain "sequencer election"). Enforces canValidatorSubmit (priority + submission window) for batch submission.

Deployed addresses are in ../reference/addresses.md. The design rationale and integration flow are described in ../vpa/multi-signer-integration.md and ../vpa/vpa-as-sequencer.md.

Roles (ValidatorState)

  • Owner — token holder who owns one or more nodes (nodeIdToOwner, userTokenIds). Controls mint, burn, and operator assignment; receives claimable tokens after burn.
  • Validator — address assigned to operate one or more nodes (assignValidatorToNode); one validator can operate N nodes.
  • Signer — address authorized to send on-chain submission transactions for a single node (signerToNodeId). The VPA / ProtocolState resolve nodeId from the signer in canValidatorSubmit(msg.sender). Managed via addAuthorizedSigner / removeAuthorizedSigner.

How submission authorization works

signer (msg.sender)
  └─ ValidatorState.signerToNodeId(signer) ─▶ nodeId
        └─ VPA.getHistoricalPriority(dataMarket, epochId, nodeId) ─▶ priority
              └─ priority + submission window ─▶ canValidatorSubmit == true

ProtocolState.submitSubmissionBatch calls ValidatorPriorityAssigner.canValidatorSubmit(dataMarket, epochId, msg.sender), which resolves the signer to a node, checks the assigned priority for that epoch, and verifies the current time falls inside that priority's submission window (preSubmissionWindow → p1SubmissionWindow → staggered pNSubmissionWindow per priority).

Dependencies

These files are published as source artifacts, not as a standalone compilable project. To compile, place them alongside the rest of the protocol contracts:

  • ValidatorPriorityAssigner.sol imports ./DataMarket.sol and ./ValidatorState.sol. DataMarket.sol (and ProtocolState.sol) are in the published Powerloom protocol contracts repository under github.com/powerloom.
  • Both use OpenZeppelin upgradeable contracts (@openzeppelin/contracts-upgradeable) and are deployed behind UUPS proxies.
  • Solidity 0.8.24.

License

SPDX-License-Identifier: MIT (as declared in each file). Note this differs from the CC BY 4.0 license that covers the prose documentation in this repository.