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

refactor: Minor updates post SDK-v2 bump #1125

Closed
wants to merge 1 commit into from
Closed

refactor: Minor updates post SDK-v2 bump #1125

wants to merge 1 commit into from

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Dec 19, 2023

This includes the recent SDK change to remove latestBlockNumber from the {Hub,Spoke}PoolClient implementations.

@pxrl pxrl added the do not merge Don't merge until label is removed label Dec 19, 2023
@pxrl
Copy link
Contributor Author

pxrl commented Dec 19, 2023

Note also overlap with this PR: https://github.com/across-protocol/relayer-v2/pull/1124/files

I'll cross-check to see whether there are any differences.

@pxrl pxrl marked this pull request as draft December 19, 2023 03:58
@pxrl pxrl changed the title chore: Bump sdk-v2 refactor: Minor updates post SDK-v2 bump Dec 19, 2023
@pxrl
Copy link
Contributor Author

pxrl commented Dec 19, 2023

I'll repurpose this to include some of the minor refactoring that isn't covered by Nick's PR.

@pxrl pxrl changed the base branch from master to pxrl/hubPoolTokenUpdates January 2, 2024 05:56
Base automatically changed from pxrl/hubPoolTokenUpdates to master January 3, 2024 19:56
Comment on lines 1939 to 1634
if (followingBlockNumber === undefined) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this change behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't be possible, since that would require that the HubPoolClient instance was never updated. I can't see how we'd end up this deep in the code without having done that. For instance, this code lives in a loop that iterates over parsed root bundles, so if we haven't done an update then we'd never enter into the loop because there'd be nothing to iterate over.

As background, latestBlockSearched was previously defined as number | undefined, but is now defined as latestBlockSearched = 0. So to retain 100% matching logic, we'd check if (followingBlockNumber === 0), but in practice I think the check was only necessary to silence tsc "possibly undefined" warnings.

This bump clears a hurdle where some newly introduced types have been
slightly renamed. The internal definitions of these types was also
reorganised to use RelayData as the core/common part of each type.
@pxrl pxrl closed this Feb 2, 2024
@pxrl pxrl deleted the pxrl/bumpSDK branch February 2, 2024 23:34
@pxrl pxrl restored the pxrl/bumpSDK branch February 2, 2024 23:34
@pxrl pxrl deleted the pxrl/bumpSDK branch February 6, 2024 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Don't merge until label is removed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants