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

Add a relayers endpoint to get the estimate when NEAR -> Ethereum transaction will be relayed #522

Open
alexauroradev opened this issue Mar 11, 2021 · 2 comments

Comments

@alexauroradev
Copy link

This will improve indication on the frontend for how long the user should wait for sync

@mfornet
Copy link
Contributor

mfornet commented Mar 17, 2021

There are two places two update:

  1. Near Client on Ethereum. This contract should expose:
    • currentHeight: Heights that considered finals.
    • nextHeight: Next height that will become final. (Can be equal to currentHeight if there is no new block relayed)
    • timeToNextHeight: Timestamp when nextHeight is considered final.

There is a little difference between (currentHeight/nextHeight) vs (trustedHeader.height / untrustedHeader.height). Since untrustedHeader.height can become final before relaying a new block.

This information can be used by tools (such as the UI) to determine the expected time such that action on Ethereum is considered final.

  1. Near2Eth relayer

In the relayer we should expose the frequency at which blocks are being relayed, which is the next block height, and at when it will be submitted.

@alexauroradev
Copy link
Author

It seems that NEAR Client already is showing the correct info. See here: https://github.com/near/rainbow-bridge/blob/master/contracts/eth/nearbridge/contracts/NearBridge.sol#L195-L213

So only the Near2Eth should be updated.

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

No branches or pull requests

2 participants