Skip to content

Commit 267499b

Browse files
author
Jiacheng Zhang
committed
feat: encodedOperator in getRuntimeInfo
1 parent 5cc0799 commit 267499b

File tree

4 files changed

+602
-577
lines changed

4 files changed

+602
-577
lines changed

src/lifecycle/runner/pruntime.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,17 @@ export const setupRuntime = (workerContext) => {
8383

8484
const triggerRa = async (runtime) => {
8585
const { initInfo, rpcClient, workerContext } = runtime
86+
const { pool } = workerContext
87+
8688
workerContext.message = 'Getting RA report...'
87-
let res = await rpcClient.getRuntimeInfo({})
89+
let res = await rpcClient.getRuntimeInfo({
90+
forceRefreshRa: true,
91+
encodedOperator: Buffer.from(
92+
pool.isProxy
93+
? phalaApi.createType('AccountId', pool.proxiedAccountSs58).toU8a()
94+
: pool.pair.addressRaw
95+
),
96+
})
8897
res = res.constructor.toObject(res, {
8998
defaults: true,
9099
enums: String,

src/lifecycle/runner/state_machine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ const wrapEventAction = (fn) => (fromState, toState, context) =>
3737
})
3838

3939
const onStarting = async (fromState, toState, context) => {
40-
const { pid, snapshotBrief, runtime, innerTxQueue, forceRa } =
40+
const { pid, snapshotBrief, runtime, innerTxQueue } =
4141
context.stateMachine.rootStateMachine.workerContext
4242

4343
await innerTxQueue.add(async () => {
4444
if (shouldSkipRa) {
4545
logger.warn(
4646
snapshotBrief,
47-
'Requesting to force refreshing RA report is ignored when `snapshotBrief` is enabled. '
47+
'Requesting to force refreshing RA report is ignored when `forceRa` is enabled. '
4848
)
4949
return initRuntime(
5050
runtime,

src/vendor/prpc-proto

0 commit comments

Comments
 (0)