From 92a19285c13f3baa08739cb771b4ab9c02cc22be Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Mon, 4 Dec 2023 08:58:15 -0600 Subject: [PATCH 1/2] fix(agoric): print errors while following --- packages/agoric-cli/src/follow.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/agoric-cli/src/follow.js b/packages/agoric-cli/src/follow.js index c39ceefb705..745afc5830f 100644 --- a/packages/agoric-cli/src/follow.js +++ b/packages/agoric-cli/src/follow.js @@ -142,9 +142,12 @@ export default async function followerMain(progname, rawArgs, powers, opts) { verbose && console.warn('Following', spec); const castingSpec = makeCastingSpec(spec); const follower = makeFollower(castingSpec, leader, followerOptions); - for await (const { value, blockHeight, currentBlockHeight } of iterate( - follower, - )) { + for await (const obj of iterate(follower)) { + if ('error' in obj) { + console.error('Error following:', obj.error); + continue; + } + const { value, blockHeight, currentBlockHeight } = obj; const blockHeightPrefix = opts.blockHeight ? `${blockHeight}:` : ''; const currentBlockHeightPrefix = opts.currentBlockHeight ? `${currentBlockHeight}:` From 97be818c4f5c507830f70392f334fa60dd6d7f94 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Mon, 4 Dec 2023 09:00:30 -0600 Subject: [PATCH 2/2] fix(casting): properly follow an unpopulated state entry --- packages/casting/src/follower-cosmjs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/casting/src/follower-cosmjs.js b/packages/casting/src/follower-cosmjs.js index 20bc14aa7d7..206d6c2c494 100644 --- a/packages/casting/src/follower-cosmjs.js +++ b/packages/casting/src/follower-cosmjs.js @@ -450,9 +450,11 @@ export const makeCosmjsFollower = ( // contain data. await null; for (;;) { - ({ value: cursorData, height: cursorBlockHeight } = + let thisHeight; + ({ value: cursorData, height: thisHeight } = await getDataAtHeight(cursorBlockHeight)); if (cursorData.length !== 0) { + cursorBlockHeight = thisHeight; const cursorStreamCell = streamCellForData( cursorBlockHeight, cursorData,