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

feat(unstaking): Instant unstake forecasting #12122

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

EvgeniiVoznyuk
Copy link
Contributor

@EvgeniiVoznyuk EvgeniiVoznyuk commented Apr 24, 2024

Description

Instant unstake forecasting is added to the eth unstaking modal

Related Issue

Resolve trezor#11402

Screenshots:

image image

@tomasklim
Copy link
Member

Screen.Recording.2024-04-25.at.17.49.11.mov

Would be nice to see max amount there

@tomasklim

This comment was marked as outdated.

@EvgeniiVoznyuk EvgeniiVoznyuk force-pushed the feat/unstake-eth-instant-forecasting branch from 6b016e8 to b65e608 Compare April 29, 2024 06:24
@komret komret removed their request for review August 5, 2024 09:25
@tomasklim tomasklim added the blocked Blocked by external force. Third party inputs required. label Aug 6, 2024
@tomasklim tomasklim removed the blocked Blocked by external force. Third party inputs required. label Sep 25, 2024
@dev-pvl dev-pvl force-pushed the feat/unstake-eth-instant-forecasting branch from b65e608 to f0507c1 Compare October 2, 2024 09:32
@@ -0,0 +1,65 @@
// origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EthereumCall.js
Copy link
Contributor

Choose a reason for hiding this comment

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

this link does not exist

Copy link
Contributor

Choose a reason for hiding this comment

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

removed, 77ca47b

request: EthereumCallSchema;
};

export default class EthereumCall extends AbstractMethod<'ethereumCall', Params> {
Copy link
Contributor

@mroz22 mroz22 Oct 9, 2024

Choose a reason for hiding this comment

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

why not prefix it with blockchain.. similarly to other blockchain-link interfacing methods? I'd like to know your motivation for this naming

Copy link
Contributor

@mroz22 mroz22 left a comment

Choose a reason for hiding this comment

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

please reorganize commits in the way that blockchain-link is a standalone commit and connect is a standalone commit.

@tomasklim
Copy link
Member

tomasklim commented Oct 9, 2024

I know it is called ethereumCall in BlockBook, but I would probably call it rpcCall (or something else) in the connect codebase so that it is also ready for other networks (just in case).

(probably makes sense to give it better name in blockbook too)

@marekrjpolak
Copy link
Contributor

marekrjpolak commented Oct 9, 2024

@tomasklim @mroz22 method name ethereumCall and the fact it's located in api/ethereum/api/* ensures that code splitting will work as expected and the method will be in the correct bundle, which is now ethereum* for all EVM shitcoins. (see https://github.com/trezor/trezor-suite/blob/develop/packages/connect/src/core/method.ts)

If and only if we're 💯 sure there will never be any coin-specific 3rd party dependency related to this method, I'm not against prefixing it with blockchain*, renaming to something eth-unrelated or whatever.

@tomasklim tomasklim force-pushed the feat/unstake-eth-instant-forecasting branch from c68d31b to e3cc1f5 Compare October 9, 2024 13:23
@tomasklim
Copy link
Member

please reorganize commits in the way that blockchain-link is a standalone commit and connect is a standalone commit.

done

@tomasklim
Copy link
Member

In case you run into troubles. The blockbook api ethCall is going to be renamed. Please check https://holesky1.trezor.io/test-websocket.html if it is still called ethCall or if it got renamed already.

it should be rpcCall

@dev-pvl dev-pvl force-pushed the feat/unstake-eth-instant-forecasting branch from ec4efe1 to 24f1a0d Compare October 14, 2024 12:07
@dev-pvl
Copy link
Contributor

dev-pvl commented Oct 14, 2024

@tomasklim, I added fixes and rebased everything. What do we decide with renaming? For now, I only renamed ethCall to rpcCall where needed.

Copy link
Member

@tomasklim tomasklim left a comment

Choose a reason for hiding this comment

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

Please squash and rebase, there are conflicts.

Any ideas how to test it? right now it does not show any interchanges on holesky/eth

@dev-pvl dev-pvl force-pushed the feat/unstake-eth-instant-forecasting branch from 24f1a0d to 1807f1e Compare October 21, 2024 10:49
@dev-pvl
Copy link
Contributor

dev-pvl commented Oct 21, 2024

@tomasklim I added the changes you asked for. The easiest way to test it locally is to change const interchanges = 0; to 1 or any non-zero value in suite/src/utils/suite/stake.ts simulateUnstake() method.

@tomasklim tomasklim self-requested a review October 21, 2024 17:44
@tomasklim tomasklim requested a review from mroz22 October 26, 2024 09:53
@tomasklim tomasklim force-pushed the feat/unstake-eth-instant-forecasting branch from 9e1a100 to 3f593fe Compare October 26, 2024 09:53
@tomasklim
Copy link
Member

@dev-pvl and what is the reason to have there 0? What number of interchanges do we use for unstake?

Copy link
Member

@tomasklim tomasklim left a comment

Choose a reason for hiding this comment

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

LGTM

However, I do not understand why it is visible only when interchanges is greater than 0. Why do we implement it when we do not increase this number for simulation of unstake and unstake itself?

with interchanges = 1
Screenshot 2024-10-26 at 12 06 22

waiting for greens here #15085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: 🏃‍♂️ In progress
Development

Successfully merging this pull request may close these issues.

Unstaking: Instant unstake forecasting
7 participants