Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos hardfork support #811

Merged
merged 3 commits into from
Aug 9, 2024
Merged

Cosmos hardfork support #811

merged 3 commits into from
Aug 9, 2024

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented Jul 31, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

@peachbits peachbits force-pushed the matthew/thorchain-hardfork branch from 1aeb752 to 163a0bc Compare August 5, 2024 23:56
@peachbits peachbits marked this pull request as ready for review August 7, 2024 17:40
if (this.networkInfo.chainIdUpdateUrl != null) {
try {
const res = await this.fetchCors(this.networkInfo.chainIdUpdateUrl)
const raw = await res.json()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check !res.ok send throw await res.text() to get better details on failure

this.otherData[query]?.newestTxid !== newestTxid
) {
this.otherData[query] = { newestTxid }
this.otherData.archivedTxLastCheckTime = lastTimestamp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting archivedTxLastCheckTime inside the for loop of txQueryStrings could cause the receiver query type to not execute since archivedTxLastCheckTime is global to both send and receive queries

for (const clients of clientsList) {
const { newestTxid, lastTimestamp } = await this.queryTransactionsInner(
query,
clients
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the starting page seems to mean you'll be querying all transactions every time and not continuing from where you left off.

@peachbits peachbits changed the title WIP - Cosmos hardfork support Cosmos hardfork support Aug 7, 2024
@@ -559,7 +557,10 @@ export class CosmosEngine extends CurrencyEngine<
this.otherData[query]?.newestTxid !== newestTxid
) {
this.otherData[query] = { newestTxid }
this.otherData.archivedTxLastCheckTime = lastTimestamp
this.otherData.archivedTxLastCheckTime = Math.max(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with requested small change of only setting archivedTxLastCheckTime once both send and recv transactions sycned.

@peachbits peachbits force-pushed the matthew/thorchain-hardfork branch from 3e5113b to 00761cf Compare August 9, 2024 01:06
This adds support for multiple archive nodes, which is necessary to support a chain over multiple hardforks.
@peachbits peachbits force-pushed the matthew/thorchain-hardfork branch from 00761cf to 534bf2a Compare August 9, 2024 18:05
@peachbits peachbits enabled auto-merge August 9, 2024 18:06
@peachbits peachbits merged commit d4f06c2 into master Aug 9, 2024
2 checks passed
@peachbits peachbits deleted the matthew/thorchain-hardfork branch August 9, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants