22 GRAPH_TOKEN_ABI ,
33 ISSUANCE_ALLOCATOR_ABI ,
44 ISSUANCE_TARGET_ABI ,
5+ REWARDS_MANAGER_DEPRECATED_ABI ,
56 SET_TARGET_ALLOCATION_ABI ,
67} from '@graphprotocol/deployment/lib/abis.js'
78import { getTargetChainIdFromEnv } from '@graphprotocol/deployment/lib/address-book-utils.js'
@@ -11,7 +12,7 @@ import {
1112} from '@graphprotocol/deployment/lib/contract-checks.js'
1213import { Contracts } from '@graphprotocol/deployment/lib/contract-registry.js'
1314import { canSignAsGovernor } from '@graphprotocol/deployment/lib/controller-utils.js'
14- import { ComponentTags , GoalTags } from '@graphprotocol/deployment/lib/deployment-tags.js'
15+ import { assumeUpgraded , ComponentTags , GoalTags } from '@graphprotocol/deployment/lib/deployment-tags.js'
1516import {
1617 createGovernanceTxBuilder ,
1718 executeTxBatchDirect ,
@@ -68,9 +69,18 @@ export default createActionModule(
6869 // Create viem client for direct contract calls
6970 const client = graph . getPublicClient ( env ) as PublicClient
7071
71- // Check if RewardsManager supports IIssuanceTarget (has been upgraded)
72- // Throws error if not upgraded
73- await requireRewardsManagerUpgraded ( client , rmAddress , env )
72+ const sequenced = assumeUpgraded ( )
73+
74+ // Check if RewardsManager supports IIssuanceTarget (has been upgraded).
75+ // Throws if not upgraded — skipped under sequenced generation, where this
76+ // bundle is built to execute right after the upgrade bundle (nonce order).
77+ if ( ! sequenced ) {
78+ await requireRewardsManagerUpgraded ( client , rmAddress , env )
79+ } else {
80+ env . showMessage (
81+ '\n⚠ Sequenced generation: RM upgrade assumed — this bundle is SEQUENCED-ONLY and valid only AFTER the upgrade bundle executes (nonce order).\n' ,
82+ )
83+ }
7484
7585 const targetChainId = await getTargetChainIdFromEnv ( env )
7686
@@ -86,7 +96,35 @@ export default createActionModule(
8696 // Sub-flags drive both the per-line status display and which TXs the build-batch needs.
8797 env . showMessage ( '📋 Checking current activation state...\n' )
8898
89- const connect = await checkIssuanceConnectComplete ( client , iaAddress , rmAddress , gtAddress )
99+ // Sequenced generation: RM isn't upgraded yet, so RM.getIssuanceAllocator (the
100+ // iaIntegrated read inside checkIssuanceConnectComplete) would revert. Assume the
101+ // RM-side wiring is undone and emit it. The rate invariant below is still enforced
102+ // — both rates are readable on the un-upgraded RM. IA-side reads (default target)
103+ // stay live in the TX-build section downstream.
104+ const connect = sequenced
105+ ? {
106+ complete : false ,
107+ iaIntegrated : false ,
108+ iaMinter : false ,
109+ rmAllocationShape : false ,
110+ fullyAllocated : false ,
111+ iaRate : ( await client . readContract ( {
112+ address : iaAddress as `0x${string } `,
113+ abi : ISSUANCE_ALLOCATOR_ABI ,
114+ functionName : 'getIssuancePerBlock' ,
115+ } ) ) as bigint ,
116+ rmRate : ( await client . readContract ( {
117+ address : rmAddress as `0x${string } `,
118+ abi : REWARDS_MANAGER_DEPRECATED_ABI ,
119+ functionName : 'issuancePerBlock' ,
120+ } ) ) as bigint ,
121+ get ratesAligned ( ) : boolean {
122+ return this . iaRate === this . rmRate
123+ } ,
124+ currentIssuanceAllocator : '(unknown — RM not upgraded)' ,
125+ rmAllocation : { selfMintingRate : 0n , allocatorMintingRate : 0n } ,
126+ }
127+ : await checkIssuanceConnectComplete ( client , iaAddress , rmAddress , gtAddress )
90128
91129 env . showMessage (
92130 ` IA integrated: ${ connect . iaIntegrated ? '✓' : '✗' } (current: ${ connect . currentIssuanceAllocator } )` ,
0 commit comments