-
Notifications
You must be signed in to change notification settings - Fork 90
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
Market orders deprecation date remove #2536
Conversation
The PR is ready to be reviewed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall just surprised by 2 test changes.
); | ||
|
||
let services = Services::new(onchain.contracts()).await; | ||
let solver_endpoint = colocation::start_naive_solver().await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this test have to be removed. I think it's one of few (maybe the only one?) that tests that the naive solver is actually able to settle batches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naive solver does not support limit orders. When switched to using baseline (which does not do batch) I ended up with a classic limit order e2e test which is already covered with other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, right. Forgot that naive doesn't support computing the fee. 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard would it be to teach the naive solver to compute fees? On a high level it should be less hard than what the baseline solver does since it only ever uses one kind of pool? I think it would be good to have some basic CoW test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think we agreed on slack to ditch Naive solver (this PR is happy for it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we capture a task to bring this test back if we resurrect naive solver (I do think for e2e tests specifically it would be good to have a solver that's capable of matching basic CoWs)
LGMT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I think we are removing a few e2e tests that are still adding value.
@@ -125,6 +123,6 @@ async fn eth_integration(web3: Web3) { | |||
); | |||
assert_eq!( | |||
trader_b_eth_balance_after - trader_b_eth_balance_before, | |||
49_776_284_258_574_379_601_u128.into() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests strike me as useful as a chocolate teapot, basically whenever they fail we just rerun the assertion and update the value (so it's not really testing anything useful).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the proper assert here would be
trader_b_eth_balance_after >= 49 eth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed as suggested by myself 😄
@@ -148,122 +131,6 @@ async fn eth_flow_tx_zero_fee(web3: Web3) { | |||
.await; | |||
} | |||
|
|||
async fn eth_flow_tx(web3: Web3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this test removed, it still seems legit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I spent some time figuring out why some tests were removed. Would appreciate more context on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not actually removed, it's just code diff shows it in a weird way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local_node_eth_flow_insufficient_fee
and local_node_eth_flow_zero_fee
are removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and local_node_eth_flow_tx
is changed to be actually local_node_eth_flow_zero_fee
:)
@@ -297,132 +291,6 @@ async fn two_limit_orders_test(web3: Web3) { | |||
assert!(balance_after_b.checked_sub(balance_before_b).unwrap() >= to_wei(2)); | |||
} | |||
|
|||
async fn mixed_limit_and_market_orders_test(web3: Web3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, this test case still seems useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove market order as we do not support it anymore, we are left with 1 limit order (which is actually in-market) and we already have this test covered with local_node_single_limit_order
); | ||
|
||
let services = Services::new(onchain.contracts()).await; | ||
let solver_endpoint = colocation::start_naive_solver().await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard would it be to teach the naive solver to compute fees? On a high level it should be less hard than what the baseline solver does since it only ever uses one kind of pool? I think it would be good to have some basic CoW test coverage.
); | ||
|
||
let services = Services::new(onchain.contracts()).await; | ||
let solver_endpoint = colocation::start_naive_solver().await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we capture a task to bring this test back if we resurrect naive solver (I do think for e2e tests specifically it would be good to have a solver that's capable of matching basic CoWs)
@@ -13,7 +13,6 @@ pub enum OnchainOrderPlacementError { | |||
DisabledOrderClass, | |||
ValidToTooFarInFuture, | |||
InvalidOrderData, | |||
InsufficientFee, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, wonder If I am allowed to delete the variant (for backward compatibility with older orders that might have this error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, this would probably lead to issues if the order is read from disk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the bare minimum of InsufficientFee
in database so that, when we fetch old orders that have this error, nothing breaks.
Captured the remaining task: #2578 |
Description
Removes
market_orders_deprecation_date
as required in #2462. (no need to removerank_by_surplus_date
just yet)Once removed, tests started failing, so we need to convert all tests for market orders to work with limit orders or to remove them if they don't make sense anymore.
How to test
Existing tests.