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

improve(dataworker): Remove transferThreshold #937

Merged
merged 17 commits into from
Sep 29, 2023

Conversation

nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented Sep 13, 2023

Fixes ACX-1537

Removes a lot of code needed to support deprecated config store variable that is always set to 0 in production

Depends on across-protocol/sdk#388

@linear
Copy link

linear bot commented Sep 13, 2023

ACX-1537 Remove `transferThreshold` from ConfigStore

This config was deprecated and replaced by spokeTargetBalances and has a lot of code/unit tests that are no longer useful

nicholaspai added a commit to across-protocol/sdk that referenced this pull request Sep 13, 2023
nicholaspai added a commit to across-protocol/sdk that referenced this pull request Sep 19, 2023
@nicholaspai nicholaspai marked this pull request as ready for review September 21, 2023 19:08
@nicholaspai nicholaspai added the do not merge Don't merge until label is removed label Sep 21, 2023
@nicholaspai
Copy link
Member Author

Can't merge this until the VERSION is bumped to 2 in the ConfgiStore contract

1 similar comment
@nicholaspai
Copy link
Member Author

Can't merge this until the VERSION is bumped to 2 in the ConfgiStore contract

@nicholaspai nicholaspai removed the do not merge Don't merge until label is removed label Sep 26, 2023
nicholaspai and others added 10 commits September 26, 2023 10:18
Fixes ACX-1537

Removes a lot of code needed to support deprecated config store variable that is always set to 0 in production
This reverts commit 381e5bf.
* chore: bump sdk to latest

* chore: bump version

* chore: bump sdk
@nicholaspai nicholaspai force-pushed the npai/transfer-threshold-removal branch from d7b9666 to 90cb0d1 Compare September 26, 2023 14:18
@nicholaspai
Copy link
Member Author

@james-a-morris @pxrl this is ready to be re-reviewed now and works locally against prod

@james-a-morris
Copy link
Contributor

@james-a-morris @pxrl this is ready to be re-reviewed now and works locally against prod

SGTM - will add this to my plate

src/dataworker/Dataworker.ts Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm, is this necessitated by the realizedLpFeePct change?

I like that this simplifies the test quite a bit, but I also sometimes like that we verify events at a deeper level, just to be sure that we aren't tricking ourselves somehow.

Copy link
Member Author

Choose a reason for hiding this comment

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

So for some reason the object key order changes when I make changes to the interface of the Fill object. This is probably some weird nodejs thing. I also think we verify the deep properties of the object in other places

Copy link
Contributor

@pxrl pxrl Sep 29, 2023

Choose a reason for hiding this comment

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

Is it confirmed related to changes in the Fill object, or could it be related to the bump in ts that happened as part of the tsdx migration? That happened in the bump to 0.16.1, so we are bundling that in here.

(As a background thought, I'm wondering if we might consider bumping to 0.16.1 first in order to rule out any potential regressions as part of that?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ive confirmed its the order of the keys switching

Copy link
Member Author

Choose a reason for hiding this comment

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

Also these changes i noticed before we integrated tsdx so i don't think its related


// Updating the client should not impact anything.
await updateAllClients();
expect(deepEqualsWithBigNumber(tokenClient.getTokenShortfall(), expectedData2)).to.be.true;
expect(tokenShortFallData2).to.deep.equal(tokenClient.getTokenShortfall()[destinationChainId][erc20_2.address]);
Copy link
Contributor

Choose a reason for hiding this comment

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

I vaguely recall that we previously had problems with to.deep.equal on BigNumbers (i.e. it could sometimes incorrectly report equality). Do you know if that can still pose an issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm I'm not sure exactly. I changed this because the deepEquals didn't seem to be deeply traversing the object as expected

Copy link
Contributor

Choose a reason for hiding this comment

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

Per #937 (comment), I'm wondering if there's some subtle change as a result of bumping tsc. We skipped a lot of versions.

@nicholaspai nicholaspai requested a review from pxrl September 28, 2023 19:25
…tamps (#944)

* improve(dataworker): Remove `transferThreshold`

Fixes ACX-1537

Removes a lot of code needed to support deprecated config store variable that is always set to 0 in production

* Update Dataworker.ts

* bumpity

* Update Dataworker.ts

* Update package.json

* Update yarn.lock

* wip

* fix(Dataworker): Dereference originChainId by index, not key (#936)

* fix(Dataworker): Dereference originChainId by index, not key

Temporary fix to resolve an issue with future quoteTimestamps. We need a
more robust solution than this in the long run.

* Extract originToken from array

* lint

* WIP

Signed-off-by: Matt Rice <[email protected]>

---------

Signed-off-by: Matt Rice <[email protected]>
Co-authored-by: Matt Rice <[email protected]>

* improve: leverage default TTL & leverage caching (#938)

* improve: leverage default TTL

* improve: set fn signature to default

* feat: add dataworker force bundle range (#912)

* feat: add dataworker force bundle range

* docs: add documentation to example env

* improve: allow for boba

* improve: allow forced proposal range with sending

---------

Co-authored-by: Paul <[email protected]>

* feat: test chain routes (#897)

* feat: Script for automating SpokePool deposits

This is useful for making deposits to the zkSync SpokePool(s) because
zkSync's block explorer doesn't yet support making transactions via
proxy contracts.

* Add yarn script target + tweak usage

* Add basic support for dumping SpokePool config

* lint

* fix: Gracefully handle token searches where token missing

Not all tokens are defined on all chains, so don't try to drop case
unless the token actually exists on a chain.

* Add "fetch" for dumping deposit and fill information

Currently limitations:
 - Does not display updated values (i.e. after a speed-up).
 - Does not display message data.
 - Should normalise from the token decimals for better readability.
 - Does not gracefully handle when the txnHash is not found.

* lint

* fix conflict

* lint

* chore: allow base-units to easily be sent

* chore: allow token to be passed as origin token addr or symbol

* feat: test chain routes

* nit: improve docs

* docs: add docs

* improve: account for checksummed value

Co-authored-by: Paul <[email protected]>

* improve: remove unneeded flag

Co-authored-by: Paul <[email protected]>

* improve: docs

Co-authored-by: Paul <[email protected]>

* improve: do not hardcode amounts

* improve: modification

* improve: dynamically compute price

---------

Co-authored-by: Paul <[email protected]>
Co-authored-by: nicholaspai <[email protected]>

* WIP

* Update yarn.lock

* Revert "WIP"

This reverts commit 381e5bf.

* feat: Add protection against computing LP fees for future quote timestamps

This resolves the [reverted SDK PR](across-protocol/sdk#399) and re-introduces protection from deposit quote timestamps that are impossible to compute.

This PR essentially moves that protection to the production version of Hub and Spoke clients so that the unit tests can continue to work and not have to add additional logic to set quote times correctly. Ideally in the future we set the quote times how they would in production but for now this solution results in a much smaller code diff

* lint

* fix

* lint

* Update HubPoolClient.ts

* refactor: Import getNetworkName from sdk (#945)

* chore: bump sdk to latest (#943)

* chore: bump sdk to latest

* chore: bump version

* chore: bump sdk

---------

Signed-off-by: Matt Rice <[email protected]>
Co-authored-by: Paul <[email protected]>
Co-authored-by: Matt Rice <[email protected]>
Co-authored-by: James Morris, MS <[email protected]>
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -18,4 +19,20 @@ export class HubPoolClient extends clients.HubPoolClient {
ignoredHubProposedBundles: IGNORED_HUB_PROPOSED_BUNDLES,
});
}

async computeRealizedLpFeePct(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think this code from a different branch accidentally got included here. These commits should be removed (or just merge master) before merging.

Copy link
Member Author

Choose a reason for hiding this comment

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

nope, that other PR was merged into this branch!

@@ -11,7 +11,7 @@
},
"dependencies": {
"@across-protocol/contracts-v2": "2.4.3",
"@across-protocol/sdk-v2": "0.15.24",
"@across-protocol/sdk-v2": "0.16.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

How did we get this far behind...? Can you just double check the changes that get pulled in here (considering the number of bumps)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe 0.15.24 was the last release before 0.16 and that's because https://github.com/across-protocol/sdk-v2/releases/tag/v0.16.0 introduced the removal of the transferThreshold variable!

This PR has been sitting for a while haha

@nicholaspai nicholaspai requested a review from mrice32 September 29, 2023 02:30
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fast response!

@nicholaspai nicholaspai merged commit f7ea6fd into master Sep 29, 2023
2 checks passed
@pxrl pxrl deleted the npai/transfer-threshold-removal branch September 29, 2023 16:00
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.

4 participants