diff --git a/README.md b/README.md index 265a934..eda20f2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Rapid Relayer does not use the `tx_search` query of Hermes to handle packets fro - We need something more rapid. ### How We Fix This -- We removed the `tx_search` query, and handle packets in parallel across several blocks at once. +- We removed the `tx_search` query, and handled packets in parallel across several blocks at once. - Keep track of `synced_height` and `latest_height`. - Multi-threaded workers: packet handler and event feeder. The event feeder feeds the packet from new blocks to a cache and the packet handler fetches packets from it. This way, even if the packet handler stops, the event feeder will continue to operate. - We remove the slow call of `tx_search`. @@ -90,7 +90,7 @@ and a /syncInfo volume which will contain the state ```bash docker run -it -v/tmp/rr/config:/config -v/tmp/rr/syncInfo:/syncInfo -d rapid-relayer:latest ``` -this should start the relayer in a docker container using your config, and placing the state in a separate volume +this should start the relayer in a docker container using your config, and place the state in a separate volume ## SyncInfo diff --git a/src/chain/index.ts b/src/chain/index.ts index 089f9f1..9036409 100644 --- a/src/chain/index.ts +++ b/src/chain/index.ts @@ -353,12 +353,12 @@ export class Chain { } } - // filter timeout that already done. + // filter timeout that is already done. // filter by unreceivedAcks await Promise.all( Object.keys(timeoutPackets).map(async (path) => { if (timeoutPackets[path].length === 0) return - const unrecivedPackets = await this.lcd.ibc.unreceivedAcks( + const unreceivedPackets = await this.lcd.ibc.unreceivedAcks( timeoutPackets[path][0].packetData.source_port, timeoutPackets[path][0].packetData.source_channel, timeoutPackets[path].map((packet) => packet.packetData.sequence) @@ -378,14 +378,14 @@ export class Chain { await Promise.all( Object.keys(timeoutPackets).map(async (path) => { if (timeoutPackets[path].length === 0) return - const unrecivedPackets = + const unreceivedPackets = await this.counterpartyChain.lcd.ibc.unreceivedPackets( timeoutPackets[path][0].packetData.destination_port, timeoutPackets[path][0].packetData.destination_channel, timeoutPackets[path].map((packet) => packet.packetData.sequence) ) - const unrecivedSequences = unrecivedPackets.sequences.map((sequence) => + const unreceivedSequences = unrecivedPackets.sequences.map((sequence) => Number(sequence) ) @@ -395,23 +395,23 @@ export class Chain { }) ) - // filter recv packets that already done. + // filter recv packets that are already done. await Promise.all( Object.keys(recvPackets).map(async (path) => { if (recvPackets[path].length === 0) return - const unrecivedPackets = + const unreceivedPackets = await this.counterpartyChain.lcd.ibc.unreceivedPackets( recvPackets[path][0].packetData.destination_port, recvPackets[path][0].packetData.destination_channel, recvPackets[path].map((packet) => packet.packetData.sequence) ) - const unrecivedSequences = unrecivedPackets.sequences.map((sequence) => + const unreceivedSequences = unreceivedPackets.sequences.map((sequence) => Number(sequence) ) recvPackets[path] = recvPackets[path].filter((packet) => - unrecivedSequences.includes(packet.packetData.sequence) + unreceivedSequences.includes(packet.packetData.sequence) ) }) ) @@ -444,7 +444,7 @@ export class Chain { const unrecivedSequences: number[] = [] await Promise.all( packets.map(async (packet) => { - const unrecivedPackets = + const unreceivedPackets = await this.counterpartyChain.lcd.ibc.unreceivedAcks( packet.packetData.packet.source_port, packet.packetData.packet.source_channel, diff --git a/src/chain/wallet.ts b/src/chain/wallet.ts index 8ac4114..48d8bca 100644 --- a/src/chain/wallet.ts +++ b/src/chain/wallet.ts @@ -140,7 +140,7 @@ export class WalletManager { ) retried++ - // if fail to broadcast, return error result to make regenerate msgs + // if fails to broadcast, return an error result to make regenerate msgs if (retried >= MAX_RETRY) { this.requestIndexInprogress++ error(`[runRequestWorker] Max retry exceeded`) diff --git a/src/lib/rawProof.ts b/src/lib/rawProof.ts index d740f62..a27d827 100644 --- a/src/lib/rawProof.ts +++ b/src/lib/rawProof.ts @@ -33,7 +33,7 @@ export async function getRawProof( ) } - // we don't need the results, but we can ensure the data is the proper format + // we don't need the results, but we can ensure the data is in the proper format checkAndParseOp(proof.ops[0], 'ics23:iavl') checkAndParseOp(proof.ops[1], 'ics23:simple') diff --git a/src/msgs/updateClient.ts b/src/msgs/updateClient.ts index d94826c..1f121fa 100644 --- a/src/msgs/updateClient.ts +++ b/src/msgs/updateClient.ts @@ -90,7 +90,7 @@ async function getValidatorSet( count++ } const proposerAddress = block.block.header.proposer_address - // we need to query the header to find out who the proposer was, and pull them out + // we need to query the header to find out who the proposer was and pull them out const validators = await chain.rpc.validatorsAll(height) let totalVotingPower = BigInt(0) const mappedValidators: Validator[] = validators.validators.map((val) => {