diff --git a/src/index.ts b/src/index.ts index 6b29908..46586ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -85,6 +85,7 @@ async function openIbcChannel>(event: Vi state: state, } }) + await updateStats(context.db.Stat, StatName.OpenIBCChannel) } ponder.on("DispatcherSim:OpenIbcChannel", async ({event, context}) => { @@ -135,7 +136,7 @@ async function connectIbcChannel>(event: counterpartyPortId = channel.channel.counterparty.portId; } } catch (e) { - logger.info('Skipping packet for channel: ', channelId); + logger.error('Skipping packet for channel: ', channelId); } // update earliest INIT state record that have incomplete id @@ -175,6 +176,7 @@ async function connectIbcChannel>(event: } }) } + await updateStats(context.db.Stat, StatName.ConnectIbcChannel) } ponder.on("DispatcherSim:ConnectIbcChannel", async ({event, context}) => { @@ -206,6 +208,7 @@ async function closeIbcChannel>(event: V from: event.transaction.from.toString(), }, }); + await updateStats(context.db.Stat, StatName.CloseIBCChannel) } ponder.on("DispatcherSim:CloseIbcChannel", async ({event, context}) => { @@ -484,6 +487,7 @@ async function timeout>(event: Virtual.E from: event.transaction.from.toString(), }, }); + await updateStats(context.db.Stat, StatName.Timeout) } ponder.on("DispatcherSim:Timeout", async ({event, context}) => { @@ -519,6 +523,8 @@ async function writeTimeoutPacket>(event from: event.transaction.from.toString(), }, }); + + await updateStats(context.db.Stat, StatName.WriteTimeoutPacket) } ponder.on("DispatcherSim:WriteTimeoutPacket", async ({event, context}) => { diff --git a/src/stats.ts b/src/stats.ts index aaa660d..2db3d05 100644 --- a/src/stats.ts +++ b/src/stats.ts @@ -7,6 +7,8 @@ export enum StatName { RecvPackets = 'RecvPackets', AckPackets = 'AckPackets', WriteAckPacket = 'WriteAckPacket', + WriteTimeoutPacket = 'WriteTimeoutPacket', + Timeout = 'Timeout', OpenIBCChannel = 'OpenIBCChannel', CloseIBCChannel = 'CloseIBCChannel', ConnectIbcChannel = 'ConnectIbcChannel',