Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,7 @@ We welcome contributions to GenLayerJS SDK! Whether it's new features, improved
## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

### v0.6 consumer migration

See [the v2 migration guide](docs/consumer-migration-v06.md) for the staking rewards rename, producer ABI changes, execution generation, and package selection.
4 changes: 2 additions & 2 deletions docs/api-references/types.Interface.ValidatorInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ Defined in: [types/staking.ts:64](https://github.com/genlayerlabs/genlayer-js/bl

***

### live
### hasUnclaimedRewards

> **live**: `boolean`
> **hasUnclaimedRewards**: `boolean`

Defined in: [types/staking.ts:60](https://github.com/genlayerlabs/genlayer-js/blob/eaba6adec6803bdd0b4968e3f0763cf22107acd1/src/types/staking.ts#L60)

Expand Down
4 changes: 2 additions & 2 deletions docs/api-references/types.Interface.ValidatorView.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Defined in: [types/staking.ts:19](https://github.com/genlayerlabs/genlayer-js/bl

***

### live
### hasUnclaimedRewards

> **live**: `boolean`
> **hasUnclaimedRewards**: `boolean`

Defined in: [types/staking.ts:30](https://github.com/genlayerlabs/genlayer-js/blob/eaba6adec6803bdd0b4968e3f0763cf22107acd1/src/types/staking.ts#L30)

Expand Down
66 changes: 66 additions & 0 deletions docs/consumer-migration-v06.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# v0.6 consumer migration

This v2 SDK update targets the JM/Claudio/Kiril consensus train, audited at
`genlayerlabs/genlayer-consensus@c4749a42095bcfb9de69bef4f4fd5e9a6a2f86f2`
(PR #1634, above #1628). The fixture in
`tests/fixtures/consensus-consumer-abi.json` contains unmodified ABI entries
from that revision's `abis/IGenLayerStaking.json` `abis/ConsensusData.json`, and `abis/Messages.json`.
This is source compatibility evidence, not a deployment or full E2E result.

## Staking

Replace `ValidatorView.live` and `ValidatorInfo.live` with
`hasUnclaimedRewards`. There is no `live` alias. The flag reports rewards still
to be consumed at priming; it does not establish eligibility, readiness or ban
state. Continue to use `banned`, `needsPriming`, and selectable-validator APIs
for their independently defined purposes. Both boolean states are tested.

Claim `quantity`/`offset` and Commit `outstanding` now decode as `uint256`.
Their JavaScript type remains `bigint`. The producer-fixture regression uses
values above the old `uint120` boundary.

The shipped staking ABI subset also follows the producer's `delegatorClaim`
return, payable two-argument `inflationInit`, transaction-ID inputs on
idleness bans/quarantine, and `ValidatorBannedIdleness` event. Obsolete staking
selectors/events absent from this producer are removed. No administrative
wrapper or new governance journey is introduced.

## Lifecycle

`advanced.getTransactionLifecycle()` exposes optional `executionGeneration`
as an exact decimal string, independent of the retained decision's generation.
Older Studio RPCs without this field leave it absent; no generation is guessed.
A generation change invalidates cached attempt-specific receipts. Do not use
`decisionId` as a substitute for the execution generation.

An accepted, undetermined or timeout decision can still be appealed or
finalized. `waitUntil: "decided"` is appropriate for an early result; use
`waitUntil: "finalized"` to wait for stored parent finalization. Neither parent
finalization nor `getTriggeredTransactionIds()` proves all internal delivery,
refunds or payouts complete. Child lookup reads parent-filtered
`InternalMessageEffectCommitted` events from the registered Messages contract,
including deferred delivery after the decision and earlier generations. It
returns historical canonical child IDs, not an active-generation inventory.
Queries scan all history in 10,000-block pages; supply `fromBlock` at deployment
to reduce RPC work. A later lower bound intentionally excludes older children.
RPC failures propagate instead of returning a silently incomplete list. This
requires the audited producer event and does not infer IDs for older deployments.

## Package delivery and remaining qualification

Use an exact commit of PR #220 for pre-release consumers and regenerate their
lockfiles; v0/v1 semver ranges do not select this v2 train. Studio frontend and
explorer must select the same audited SDK build. Publishing a tagged npm
release remains a separate release action after qualification.

Select dev-env #145 (it includes #147 and merged #148), retaining Python #116
and E2E #781 in the consumer closure. Later qualification must compose the
implemented Node stack #1953–#1956 and its Consensus #1634 dependency, verify
one source per repository, and record the actual resolved manifest. Do not
add a reverse SDK-to-Node dependency that creates a cycle.

Outstanding integration work: full deployment/reset provenance, integrated
child-delivery journey validation, authoritative delivery-completion
API, generation-aware UI receipt invalidation, and deploy/write/read/appeal/
recompute/governance journey coverage. Native ABI tests do not qualify those
journeys or the producer's native-GEN reserve allocation.
2 changes: 1 addition & 1 deletion src/abi/consensusTrain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const parseTrainAbi = parseAbi as (signatures: readonly string[]) => Abi;
/** Minimal train ABIs used by the high-level transaction reader. */
export const CONSENSUS_DATA_TRAIN_ABI = parseTrainAbi([
"function addressManager() view returns (address)",
"function getTransactionLifecycle(bytes32 _txId, uint256 _timestamp) view returns ((uint8 storedStatus, (bytes32 txId, uint8 storedStatus, uint8 projectedStatus, uint8 action, uint8 result, bytes32 resultHash, uint8 source, uint256 sourceRound, uint256 sourceGeneration, bytes32 sourceRoundContextHash, bytes32 roundPlanHash, uint256 resultRound, uint256 resultGeneration, uint256 basisDecisionId, uint8 context, bytes32 attemptId, uint256 boundaryAt, uint256 evaluatedAt, uint256 snapshotBlock, uint256 decisionWindow, uint256 appealDeadline, bool materializesDecision, bool actionOutcomeDeterministic, bool nonCurrentEvaluation) resolution, (bool exists, uint256 decisionId, uint256 basisDecisionId, uint8 context, uint8 source, bytes32 sourceAttemptId, uint8 sourceStatus, uint8 status, uint256 sourceRound, uint256 sourceGeneration, bytes32 sourceRoundContextHash, bytes32 roundPlanHash, uint256 resultRound, uint256 resultGeneration, uint8 result, bytes32 resultHash, uint256 effectiveAt, uint256 materializedAt, uint256 appealDeadline) latestDecision, bool decisionActive) lifecycle)",
"function getTransactionLifecycle(bytes32 _txId, uint256 _timestamp) view returns ((uint8 storedStatus, (bytes32 txId, uint8 storedStatus, uint8 projectedStatus, uint8 action, uint8 result, bytes32 resultHash, uint8 source, uint256 sourceRound, uint256 sourceGeneration, bytes32 sourceRoundContextHash, bytes32 roundPlanHash, uint256 resultRound, uint256 resultGeneration, uint256 basisDecisionId, uint8 context, bytes32 attemptId, uint256 boundaryAt, uint256 evaluatedAt, uint256 snapshotBlock, uint256 decisionWindow, uint256 appealDeadline, bool materializesDecision, bool actionOutcomeDeterministic, bool nonCurrentEvaluation) resolution, (bool exists, uint256 decisionId, uint256 basisDecisionId, uint8 context, uint8 source, bytes32 sourceAttemptId, uint8 sourceStatus, uint8 status, uint256 sourceRound, uint256 sourceGeneration, bytes32 sourceRoundContextHash, bytes32 roundPlanHash, uint256 resultRound, uint256 resultGeneration, uint8 result, bytes32 resultHash, uint256 effectiveAt, uint256 materializedAt, uint256 appealDeadline) latestDecision, bool decisionActive, uint256 executionGeneration) lifecycle)",
"function estimateLatestAppealCharge(bytes32 _txId) view returns (uint256 decisionId, uint256 bond, uint256 funding, uint256 appealDeadline)",
]);

Expand Down
Loading
Loading