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

Fix surplus-related minor issues #450

Closed
4 of 9 tasks
Tracked by #459
valiafetisov opened this issue Sep 7, 2022 · 7 comments · Fixed by #468
Closed
4 of 9 tasks
Tracked by #459

Fix surplus-related minor issues #450

valiafetisov opened this issue Sep 7, 2022 · 7 comments · Fixed by #468
Assignees

Comments

@valiafetisov
Copy link
Contributor

valiafetisov commented Sep 7, 2022

Goal

Test surplus participation using simulation, document and fix related problems

Context

After the new surplus simulation was implemented in #449, we're discovered few issues already documented in the comment there. Now we want to test it further and fix related problems.

Tasks

  • Test surplus participation via the UI using new simulation
  • Test surplus participation via the bot using new simulation
  • Please pay attention to various edge cases (eg testing participation if user is the latest bidder and if not the latest bidder)
  • Document found problems, add them in the comments here
  • Fix found issues, inclusing
    • Fix uniswap price fetching when there is no bids
    • Set nextMinimumBid to make sense (eg a uniswap price * gap to reach 1k net profit)
    • SurplusAuctionBidTransactionTable "state" should display state, not just date
    • SurplusAuctionBidTransactionTable end state should count down, but count up (ie Ended 2s ago, 3s ago, etc. First guess: can be caused by invalid determination of the earliestEndDate)
@zoey-kaiser
Copy link
Contributor

I tried to start the single flapper simulation but it failed with the following error:

/Users/zoey/Documents/Development/SideStream/unified-auctions-ui/chaos-proxy/src/api.ts:20
        throw new Error(`Chaoslabs API request failed with error: ${error instanceof Error ? error.message : error}`);
              ^
Error: Chaoslabs API request failed with error: Request failed with status code 400
    at executeAPIrequest (/Users/zoey/Documents/Development/SideStream/unified-auctions-ui/chaos-proxy/src/api.ts:20:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async startSimulationInstance (/Users/zoey/Documents/Development/SideStream/unified-auctions-ui/chaos-proxy/src/api.ts:25:22)
    at async getSimulationUrl (/Users/zoey/Documents/Development/SideStream/unified-auctions-ui/chaos-proxy/src/api.ts:51:24)
    at async /Users/zoey/Documents/Development/SideStream/unified-auctions-ui/chaos-proxy/src/index.ts:22:23

@zoey-kaiser
Copy link
Contributor

zoey-kaiser commented Sep 16, 2022

  • SurplusAuctionBidTransactionTable "state" should display state, not just date

I do not understand this point. Currently the table state either displays:

  • Expires in about 20 hours ago
  • Collectable since about 2 hours ago
  • Requires Restart
  • Collected

A user can see if there are bids yet or not in the Highest Bid column, therefore I do not see the purpose in adding this information into the state column as well.

  • SurplusAuctionBidTransactionTable end state should count down, but count up (ie Ended 2s ago, 3s ago, etc. First guess: can be caused by invalid determination of the earliestEndDate)

I cannot test this as the simulation does not work properly, the helper functions do portray it properly so I agree with you that it is an issue with the retrieving or the store functions.

@valiafetisov
Copy link
Contributor Author

valiafetisov commented Sep 19, 2022

I do not understand this point. Currently the table state either displays:

  • Expires in about 20 hours ago
  • Collectable since about 2 hours ago
  • Requires Restart
  • Collected

The transaction table haven't showed this kind of thing, only the auction table. See the changes proposed in this PR to understand the difference. https://github.com/sidestream-tech/unified-auctions-ui/pull/451/files
I would actually create a separate small component to not repeat the same code to determine the state twice.

I cannot test this as the simulation does not work properly

Chaoslabs simulation are no longer maintained as you may heard. I was referencing to our own simulations implemented in #449 (as specified and linked in the readme). See core readme for more information.

@zoey-kaiser zoey-kaiser assigned aomafarag and unassigned zoey-kaiser Sep 20, 2022
@aomafarag
Copy link
Contributor

I run into the following error when trying to launch the simulation

sh: 1: Syntax error: Bad fd number
ERROR: "hardhat:silent" exited with 2.

@aomafarag
Copy link
Contributor

  • SurplusAuctionBidTransactionTable end state should count down, but count up (ie Ended 2s ago, 3s ago, etc. First guess: can be caused by invalid determination of the earliestEndDate)

@valiafetisov In SurplusAuctionBidTransactionTable, auctionEndDate is used in TimeTill, not earliestEndDate as you mentioned here. Could this be the cause of the issue?

@valiafetisov
Copy link
Contributor Author

The problem is related to the hardhat-silent command. 1>&/dev/null is there to output stdout into /dev/null in order to not print hardhat logs into the console

"hardhat:silent": "npx hardhat node 1>&/dev/null",

The quick fix would be to temporary replace 1>&/dev/null with > /dev/null or &> /dev/null (according to this article)
The proper fix would be to google for a command that works in all shells

@aomafarag
Copy link
Contributor

... The quick fix would be to temporary replace 1>&/dev/null with ... or &> /dev/null ...

I did some digging, and it seems that &> /dev/null works with zsh as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants