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

Gas fee paid in ZETA token #34

Merged
merged 7 commits into from
Nov 10, 2021
Merged

Gas fee paid in ZETA token #34

merged 7 commits into from
Nov 10, 2021

Conversation

brewmaster012
Copy link
Collaborator

@brewmaster012 brewmaster012 commented Nov 4, 2021

When a Send state variable is created, gas fee on receiver chain needs to be computed and converted into ZETA token. Then it's subtracted from the ZETA burnt, which will be the mint amount.

Right now we dont have price oracle of ZETA/ETH. We use 1.0 for testing.

The price oracle should come from 3rd party service, or from on-chain pool ration (sushi, uniswap).

This PR also creates gas estimation for the UI: example JSON query:

Should use the median price. The unit is wei (10^-18 ETH).

{
  "GasPrice": [
    {
      "creator": "meta13g3pgefm8alqv9244vdnph50tralmlnpvuypt9",
      "index": "BSC",
      "chain": "BSC",
      "prices": {
        "meta13g3pgefm8alqv9244vdnph50tralmlnpvuypt9": "10000000000",
        "meta1ftcxyydkksy2g98az595zg4v6tg96d8yx4clay": "10000000000"
      },
      "median": "10000000000",
      "blockNum": {
        "meta13g3pgefm8alqv9244vdnph50tralmlnpvuypt9": "13811498",
        "meta1ftcxyydkksy2g98az595zg4v6tg96d8yx4clay": "13811499"
      },
      "medianBlock": "13811498"
    },
    {
      "creator": "meta13g3pgefm8alqv9244vdnph50tralmlnpvuypt9",
      "index": "ETH",
      "chain": "ETH",
      "prices": {
        "meta13g3pgefm8alqv9244vdnph50tralmlnpvuypt9": "1940000300",
        "meta1ftcxyydkksy2g98az595zg4v6tg96d8yx4clay": "1940000300"
      },
      "median": "1940000300",
      "blockNum": {
        "meta13g3pgefm8alqv9244vdnph50tralmlnpvuypt9": "5788559",
        "meta1ftcxyydkksy2g98az595zg4v6tg96d8yx4clay": "5788560"
      },
      "medianBlock": "5788560"
    }
  ],
  "pagination": {
    "next_key": null,
    "total": "2"
  }
}

====
closes #33
closes #28

brewmaster012 added 7 commits November 3, 2021 22:49
@brewmaster012 brewmaster012 merged commit 0093b05 into main Nov 10, 2021
@brewmaster012 brewmaster012 deleted the gas-issue-33 branch November 10, 2021 06:52
CharlieMc0 pushed a commit that referenced this pull request Jun 27, 2023
CharlieMc0 pushed a commit that referenced this pull request Jun 27, 2023
brewmaster012 added a commit that referenced this pull request Oct 31, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2024
* import go-tss lib that removes DHT

* replace DHT with authenticated discovery

* use JSON serialization; add metric

* add new telemetry: 8123/connectedpeers; fix deadlock

in a few other 8123 handlers

* use squashed go-tss commit

* clean up interface

* address review comments

* remove whiteliste peers

* fmt

* remove rendezvous

* use merged go-tss connection gater

* use latest go-tss from PR#34

* use merged #34 in go-tss lib

* add ping RTT to telemetry

* changelog

* make linter happy

* pingrtt

* finer resolution on pingrtt time (milliseconds => nanoseconds)

* removed comments

* bump go-tss to the merged commit in master branch

* revert back to the go-tss commit

until the PR commit is merged.

---------

Co-authored-by: pwu <armiuswu@gmail.com>
gartnera pushed a commit that referenced this pull request Nov 13, 2024
* import go-tss lib that removes DHT

* replace DHT with authenticated discovery

* use JSON serialization; add metric

* add new telemetry: 8123/connectedpeers; fix deadlock

in a few other 8123 handlers

* use squashed go-tss commit

* clean up interface

* address review comments

* remove whiteliste peers

* fmt

* remove rendezvous

* use merged go-tss connection gater

* use latest go-tss from PR#34

* use merged #34 in go-tss lib

* add ping RTT to telemetry

* changelog

* make linter happy

* pingrtt

* finer resolution on pingrtt time (milliseconds => nanoseconds)

* removed comments

* bump go-tss to the merged commit in master branch

* revert back to the go-tss commit

until the PR commit is merged.

---------

Co-authored-by: pwu <armiuswu@gmail.com>
gartnera added a commit that referenced this pull request Nov 14, 2024
* feat: whitelist connection gater (#3028)

* bump go tss to remove dht

* add whitelist fields

* disable whitelist for localnet

* bump go-tss

* resolve whitelisted peers wip

* dont disable whitelist in e2e tests

* cleanup whitelist fields from config and fix e2e tests

* bump go-tss

* cleanup

* bump go tss

* use node accounts to get whitelisted peers

* bump go tss

* changelog

* fix unit test

* bump go tss

* remove usage of pointers in node accounts

* fix unit test

* revert back to using keygen for whitelist peers

---------

Co-authored-by: Alex Gartner <alexg@zetachain.com>

* fix: replace DHT with private peer discovery (#3041)

* import go-tss lib that removes DHT

* replace DHT with authenticated discovery

* use JSON serialization; add metric

* add new telemetry: 8123/connectedpeers; fix deadlock

in a few other 8123 handlers

* use squashed go-tss commit

* clean up interface

* address review comments

* remove whiteliste peers

* fmt

* remove rendezvous

* use merged go-tss connection gater

* use latest go-tss from PR#34

* use merged #34 in go-tss lib

* add ping RTT to telemetry

* changelog

* make linter happy

* pingrtt

* finer resolution on pingrtt time (milliseconds => nanoseconds)

* removed comments

* bump go-tss to the merged commit in master branch

* revert back to the go-tss commit

until the PR commit is merged.

---------

Co-authored-by: pwu <armiuswu@gmail.com>

* skip depositor fee calculation on irrelevant txs

* update changelog

---------

Co-authored-by: skosito <skostic9242@gmail.com>
Co-authored-by: brewmaster012 <88689859+brewmaster012@users.noreply.github.com>
Co-authored-by: pwu <armiuswu@gmail.com>
Co-authored-by: Charlie Chen <charliec@zetachain.com>
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.

fee determination and API synchronize nonce/gas_price for all signers
2 participants