Code Monkey home page Code Monkey logo

ethereum-burn-stats's People

Contributors

mohamedmansour avatar stevengcook avatar zachinquarantine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereum-burn-stats's Issues

Add Beacon Node proxy for Proof of Stake

Right now we listen on each node from the execution client for Proof of Work to get the metadata, and we do some stats to get the data you see today. Since Proof of Stake will come soon, we need to get ready and listen on the beacon node to get the data as well. We need a plan to implement that.

Perhaps the tasks would be broken up by:

  • Create a few Docker images that host an PoS Executor Node, and Beacon Node, on Kitsugi testnet. We need this to upgrade to more beefier system.
  • Implement a Golang client that connects to either Prysm Beacon or Lighthouse Beacon.
  • Create interface wrappers around the current PoW and PoS to gather similar metrics.
  • Update the stats.go and hub.go to use the new wrappers.
  • Update the React frontend to allow us to switch to testnet (we had previous code that does that)
  • Bring back the old countdown for testnet!

increase precision of small gas values

currently all gas numbers (so base & priority) are floored to a whole number. would it be possible to show a higher precision when gas prices are low? smth like 2 decimal places when the number is below 10 (4.23), 1 decimal place for under 100 (42.3).
image

Set the y-axis max for insights to filter outliers.

image

It would be nice if the y-axis size was capped at something like 10% higher than the 95th percentile of highs or something. This should make it so brief outliers like seen in the image above don't break usability of the dashboard for an entire year.

Golang API Server to Proxy multiple geth instances

The idea is to keep historical burn data and plot them in a chart. That requires a daemon to run other than geth. And the idea here is that clients connect to this daemon and that daemon connects to the geth instances locally. That way we can add Geth caching per api call, and we can safely not expose geth to the public.

  • I am thinking of hosting a backend server (maybe in golang so I can learn it more)
  • It connects to the geth nodes via grpc (golang to golang should be simple) and aggregates burned/basefee over time in SQLite.
  • It exposes a websocket endpoint so all the users can connect to get real-time block info (will solve the SSL issues today).

Add error handling from client websocket to server websocket

Right now we just log the error on server side, but it would be nice to have some user feedback. In the client we keep track of the promise calls and match the responses with a sequential id, we should fire a a timeout promise and if it comes back within 5 seconds, show an error/

Misleading categorization

The graph claims that a block's net_issuance is equal to its total_rewards - total_burned, but it should reflect a different metric (and potentially 3 categories):

coinbase (actually issued currency)
rewards (money paid as tip, not actually issued)
burned (amount of base_fee burned)

net_issuance = coinbase - burned

image

In my screenshot above, we see:

rewards = 3.8125
burned = 0.2562
net_issuance = (rewards - burned) = 3.5563

I'm suggesting it should be:

coinbase = 2
tip = 1.8125
burned = 0.2562
net_issuance = (coinbase - burned) = (2 - 0.2562) = 1.7438
(and, if you want) total_rewards = (coinbase + tip) = 3.8125

WebSocket connection error

Entering the site and just the "connecting to mainnet, please wait" text is visible with the animation.

Console error:
WebSocket connection to 'wss://watchtheburn.com/ws' failed:

Change the info/description for Net Issuance

Very minor label/info correction.

The burned, I think just to be more clear gas units versus 'gas used'.
The Net Issuance is the main issue, it should be 'rewards - burned' vs 'burned - rewards'.

The actual calculations look correct, just the 'info' description.

In: frontend/src/config.ts
Current:
burned: "Burned is the amount of ETH removed from circulation: gas used x base fee.",
netIssuance: "Net Issuance the amount of new ETH coming into circulation: burned - rewards.",

Should be:
burned: "Burned is the amount of ETH removed from circulation: gas units (limit) x (base fee)."
netIssuance: "Net Issuance the amount of new ETH coming into circulation: rewards - burned.",

Daemon Race for client count

This only happens on startup while running --race, just once it happens

==================
WARNING: DATA RACE
Read at 0x00c00020a450 by goroutine 98:
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).handleInitialData.func1()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:545 +0xc71
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Client).readPump()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/client.go:134 +0x57c
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).serveWebSocket·dwrap·7()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:347 +0x39

Previous write at 0x00c00020a450 by goroutine 84:
  runtime.mapassign_fast64()
      /usr/local/go/src/runtime/map_fast64.go:92 +0x0
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).listen()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:258 +0x1ea
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).ListenAndServe·dwrap·5()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:319 +0x39

Goroutine 98 (running) created at:
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).serveWebSocket()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:347 +0x405
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).serveWebSocket-fm()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:331 +0x57
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2046 +0x4d
  net/http.(*ServeMux).ServeHTTP()
      /usr/local/go/src/net/http/server.go:2424 +0xc5
  net/http.serverHandler.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2878 +0x89a
  net/http.(*conn).serve()
      /usr/local/go/src/net/http/server.go:1929 +0x12e4
  net/http.(*Server).Serve·dwrap·82()
      /usr/local/go/src/net/http/server.go:3033 +0x58

Goroutine 84 (running) created at:
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).ListenAndServe()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:319 +0xa4
  github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd.root()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd/root.go:90 +0xc9
  github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd.newRootCmd.func1()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd/root.go:42 +0x2c6
  github.com/spf13/cobra.(*Command).execute()
      /go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0xa7d
  github.com/spf13/cobra.(*Command).ExecuteC()
      /go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x5da
  github.com/spf13/cobra.(*Command).Execute()
      /go/pkg/mod/github.com/spf13/[email protected]/command.go:902 +0x29
  github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd.Execute()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd/root.go:100 +0x20
  main.main()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/main.go:8 +0x24
==================

Totals update proposal

I see a lot of people confused about the "Issued" verbiage. I'd like to propose to have 3 metrics: burned, minted, and net issued. This should alleviate the misunderstandings around those numbers. Bonus points if there's a subscript under the net issuance value that says "N% reduction" or something like that.

Current:

Totals since EIP-1559
Burned 37,554.27 ETH
Issued 71,974.85 ETH

Proposed:

Totals since EIP-1559
Burned 37,554.27 ETH
Minted 109,529.12 ETH
Net Issued 71,974.85 ETH

Show USD value to the amount burned!

Would be nice to show the USD value. One way to make this happen is to have a cronjob running to get access to current prices and store them in a json file in the same web location. We don't have a backend, just a connection to Geth

Enable SSL for WebSockets on Geth and NGINX

Need to figure out how to do reverse proxy for Geth to work on nginx to make SSL work.

Currently it is set to this but it doesn't work it, does anyone have any clue?

upstream websocket_geth {
        server 127.0.0.1:8546;
}

map $http_upgrade $connection_upgrade{
         default upgrade;
         `` close;
}

server {

        root /var/www/watchtheburn.com;

        # Add index.php to the list if you are using PHP
        index index.html;

        server_name watchtheburn.com;
        error_page 404 = /404.html;


        location /ws {
                proxy_pass http://websocket_geth;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
        }

        location / {
                try_files $uri $uri/ =404;
        }

        location /404.html {
                internal;
        }

        listen 80;
        listen [::]:80;

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/watchtheburn.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/watchtheburn.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

Gamification: Add Records

Records are nice to see top burn per day/week/all etc. And other metrics too. Something like gamification.

Imagine once people are watching, and they experience a record being broken, they can share that moment to Twitter :D

Prepare for other network launches

We currently have a setting to switch network, but it does nothing.

We would need to add chainId there to verify the network is correct, otherwise navigate to the right network. It would be nice if the user can use the block explorer, but the burned stuff would just return 0. SO including the block activation would be great.

code license

Is there a license (e.g. MIT, Apache 2.0) attached to this repo? :)

Add Auto Formatting to Main Page

Use Ether, Gwei, and Wei measurements.

Minimum Gwei should be 0.009 for it to convert
Minimum Either should be 0.009 for it to convert

Error: invalid argument 0: hex number with leading zero digits

Website refuses to load because of this. I assume it has to do with Commit e7049f8, should be pretty simple to fix?

Might as well add that it would be nice to handle errors like this (at least show a message or something). First time this happend I waited longer than I want to admit before noticing something was wrong.

Websocket Messages:

SENT: {"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}
RECV: {"jsonrpc":"2.0","id":1,"result":"0x7b"}
SENT: {"method":"eth_blockNumber","params":[],"id":2,"jsonrpc":"2.0"}
RECV: {"jsonrpc":"2.0","id":2,"result":"0x10486"}
SENT: {"method":"eth_getBlockByNumber","params":["0x10486",false],"id":3,"jsonrpc":"2.0"}
RECV: {"jsonrpc":"2.0","id":3,"result":{..., number":"0x10486",...}}
SENT: {"method":"debug_getBlockReward","params":["0x010486"],"id":4,"jsonrpc":"2.0"}
RECV: {"jsonrpc":"2.0","id":4,"error":{"code":-32602,"message":"invalid argument 0: hex number with leading zero digits"}}

Set last block for `base fee` histogram

Currently the web site displays the fees (base + priority) for a number of blocks up to the current one. Is it possible to see the fees up to a specific block?

I'm asking this because I saw something really interesting last night, but unfortunately I didn't take a screenshot and now I don't have a way to get back to it.

Would it be possible to provide a last block in the url, such as https://watchtheburn.com?last_block=14689112?

Estimated Date is all over the Place

I think you are only using the current block time to calculate the estimate, which doesn't work due to the random nature of mining.

Since you already store blocks in-browser for the chart and list, I would suggest to average their Block time for a more stable estimate.

Adding a chart for the basefee over time

It would be cool to have a chart that shows the basefee over time for the blocks that are currently loaded/cached.
Something like this maybe. Historical data would be super good, don't know if that's feasible from a performance aspect?
basefee

Generate Image for ETH Burned as Endpoint

For sharing on Social Media, it would be nice if we have a HTTP GET endpoint that generates an image with some stats on it.

  • Icon
  • Website name
  • Total Burned / etc

Then we can include it in the meta tags:

<meta property="og:title" content="WatchTheBurn.com">
<meta property="og:image" content="https://watchtheburn.com/api/social.png">
<meta property="og:description" content="Some description">
<meta name="twitter:title" content="WatchTheBurn.com">
<meta name="twitter:description" content="Some description">">
<meta name="twitter:image" content="https://watchtheburn.com/api/social.png">
<meta name="twitter:card" content="summary_large_image">

The image could be 924x461 dimensions to fit Twitter nicely.

Relayout by merging the Home and BlockList page

The navigation flow is becoming confusing. It would be nice to remove Home entirely and make the main page home page. So we would have just one page that has the stats in one row (header row), the charts in another row, and then the real-time table underneath.

Tasks

  • I am still undecided whether we want full site currency support (USD/ETH conversion) Because testnets the USD value is so little. It needs like 8 decimals to make it readable. Maybe I will keep it for just the top cards (Summary and Stats)
  • Session summary card might need to be shorter and moved to a card in Layout.tsx
  • BaseFeeChart needs to be refactored so it is just a basic chart where we specify which view to show like transaction/basefee/rewards without any pill design since we will add 3 charts there.
  • Layout.tsx is getting big might be good to refactor it into smaller components.

Breakdown hub.go

  1. When a new block comes in, send it to some processing queue
  2. Processing queue will process them one at a time,(like what we do). IT will concurrently call geth to get the information it needs instead of one transaction at a time, should use BatchRPC and Go Routins
  3. Then it passes the result to the Aggegator Queue. and passes the result to the subscription channel
  4. The aggregator queue will be processed once every minute. It will do a bunch of aggegations many metrics
  5. The latest entry per aggregation type (minute, hour, day, week, month, year) would be stored in memory and remaining persisted to disk (after that aggregation completed)
  6. Now the hard part is how to serve these in real-time, the aggregation we stored in memory will be streamed to all users as well in its own aggregator Channel

Friendly Burned Wei

From Peter:

You'll probably want to make "burned wei" a bit friendlier (e.g. add 1000 separators and maybe scale with the size (e.g. ~1.234 gwei instead of 1234567890), since once you get into meaningful basefees, those number will have 9 more digits.

Latest Stats Proposal

It would be nice to add the average ETH burnt per day since 159 launched. I'd imagine it's a fairly simple calculation, something along the lines of:

average burnt per day = (total burnt) / ( [(current epoch)-(start epoch)] \ 86400)

Current:

Latest Stats
Base Fee 56 GWEI
Watching the Burn 297 users

Proposed:

Latest Stats
Base Fee 56 GWEI
Ave Burn Per Day 4,567.89 ETH
Watching the Burn 297 users

Feature request: Twitter Bot

  • ETH ( $ value) have been burned in the last 24hrs.
  • ETH ($ value) since activation of EIP-1559.
  • When new ATH burned happened, tweet it

Chart y-axis has unformatted values

Base fee shows stuff like: 100030000000
Burned shows stuff like: 1000000000000000000 (literally only shows zeros)
I suggest to always use gwei for base fee/ ETH for burned or dynamically change the units based on what's shown

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.