mempool/frontend
Matt Corallo c5f6509a4c
Update empty block explainer to remove nonsense information
In #5061 it was suggested that the primary cause of empty blocks was due to ASICs taking some time to switch to new work, but this is not a possible reason for empty blocks - pools can mine empty or full blocks no matter how long ASICs do (or do not) take to switch to new work.

At some time T a new block is found, at some time T+1 a pool hears about this new block and desires to switch their miners to the new block. If the pool does a full block validation of the new block prior to sending new work (and updates their mempool), they can switch miners to the new work with transactions immediately. If, then, at time T+2 the ASIC finds a block based on the prior work it doesn't matter whether they were given transactions or not - the block is based on the previous tip and is just a fork.

Instead, the relevant question for empty blocks is whether the pool delays until they can fully validate the block and update their mempool (or in fact even *have* the block), selecting a first block template which contains transactions or not. #5061 tried to explain this away with an incredibly weak reference to bandwidth, but the cost of a merkle branch for a block with 4k transactions is only ~800 bytes of JSON'd hex, which shouldn't even push you into a second IP packet, let alone make for substantial bandwidth.

Its worth noting that it can take many seconds for block to make it from one pool to others, and can further take a second or two to validate a block even on fast hardware (in cases where Bitcoin Core decides to flush to disk due to cache fill), so it makes sense that you'll see empty blocks for some seconds after the previous block. @mononaut posted a chart convincingly demonstrating this - for the first few seconds after a previous block ~all blocks are empty blocks (strong evidence for spy mining or otherwise sending new work prior to updating the local mempool) and we see some dropoff of empty blocks therafter on a relatively expected distribution.

There are likely some empty blocks which are mined further past the previous block due to ASICs holding onto previous work, however the only reason those ASICs *have* previous work that is an empty block is because of spy mining or otherwise not tuning Bitcoin Core on the side of the pool to ensure they can update their mempool fast enough and get blocks fast enough to not need to send empty work at all.
2024-05-20 00:39:13 +00:00
..
.tx Migrated transifex and fetched latest translations 2023-02-18 09:39:32 +07:00
cypress [tests] testnet -> testnet4 2024-05-18 20:52:45 +02:00
src Update empty block explainer to remove nonsense information 2024-05-20 00:39:13 +00:00
.browserslistrc Reset the supported browsers list 2023-07-23 11:05:49 +09:00
.editorconfig
.eslintignore
.eslintrc Force curly if-statements 2024-05-13 17:16:28 +07:00
.gitignore Add customize.js to .gitignore 2024-05-01 22:51:58 +07:00
.prettierignore
.prettierrc
angular.json Add El Salvador theme 2024-05-07 21:03:25 +00:00
custom-sv-config.json Update el salvador twitter handle again 2024-05-13 01:23:32 +09:00
cypress.config.ts Remove the deprecated plugins file 2023-03-02 23:17:08 -08:00
frontend
generate-config.js Fix index.html generation for custom frontend builds 2024-05-14 00:15:36 +00:00
mempool-frontend-config.sample.json [tests] testnet -> testnet4 2024-05-18 20:52:45 +02:00
package-lock.json Bump cypress from 13.8.0 to 13.9.0 in /frontend 2024-05-08 15:29:38 +00:00
package.json [tests] testnet -> testnet4 2024-05-18 20:52:45 +02:00
proxy.conf.js [tests] testnet -> testnet4 2024-05-18 20:52:45 +02:00
proxy.conf.local-esplora.js Removing Bisq 2024-03-23 18:03:49 +09:00
proxy.conf.local.js Removing Bisq 2024-03-23 18:03:49 +09:00
proxy.conf.mixed.js Removing Bisq 2024-03-23 18:03:49 +09:00
proxy.conf.staging.js Removing Bisq 2024-03-23 18:03:49 +09:00
README.md Removing Bisq 2024-03-23 18:03:49 +09:00
server.run.ts Fixing SSR 2024-03-25 18:33:58 +09:00
server.ts Fixing SSR 2024-03-25 18:33:58 +09:00
shims.ts SSR ResizeObserver shim 2024-03-22 05:35:19 +00:00
sync-assets.js Don't use PATH in sync-assets.js 2024-04-01 16:53:49 +09:00
tsconfig.app.json
tsconfig.base.json Set build target to es2020 2024-04-05 15:56:10 +09:00
tsconfig.json
tsconfig.server.json Set build target to es2020 2024-04-05 15:56:10 +09:00
tsconfig.spec.json Update tsconfig for the tests 2023-08-04 08:19:19 -07:00
update-config.js

Mempool Frontend

You can build and run the Mempool frontend and proxy to the production Mempool backend (for easier frontend development), or you can connect it to your own backend for a full Mempool development instance, custom deployment, etc.

Jump to a section in this doc:

Quick Setup for Frontend Development

If you want to quickly improve the UI, fix typos, or make other updates that don't require any backend changes, you don't need to set up an entire backend—you can simply run the Mempool frontend locally and proxy to the mempool.space backend.

1. Clone Mempool Repository

Get the latest Mempool code:

git clone https://github.com/mempool/mempool
cd mempool/frontend

2. Specify Website

The same frontend codebase is used for https://mempool.space and https://liquid.network.

Configure the frontend for the site you want by running the corresponding command:

$ npm run config:defaults:mempool
$ npm run config:defaults:liquid

3. Run the Frontend

Make sure to use Node.js 16.10 and npm 7.

Install project dependencies and run the frontend server:

$ npm install
$ npm run serve:local-prod

The frontend will be available at http://localhost:4200/ and all API requests will be proxied to the production server at https://mempool.space.

4. Test

After making your changes, you can run our end-to-end automation suite and check for possible regressions.

Headless:

$ npm run config:defaults:mempool && npm run cypress:run

Interactive:

$ npm run config:defaults:mempool && npm run cypress:open

This will open the Cypress test runner, where you can select any of the test files to run.

If all tests are green, submit your PR, and it will be reviewed by someone on the team as soon as possible.

Manual Setup

Set up the Mempool backend first, if you haven't already.

1. Build the Frontend

Make sure to use Node.js 16.10 and npm 7.

Build the frontend:

cd frontend
npm install
npm run build

2. Run the Frontend

Development

To run your local Mempool frontend with your local Mempool backend:

npm run serve

Production

The npm run build command from step 1 above should have generated a dist directory. Put the contents of dist/ onto your web server.

You will probably want to set up a reverse proxy, TLS, etc. There are sample nginx configuration files in the top level of the repository for reference, but note that support for such tasks is outside the scope of this project.

Translations: Transifex Project

The Mempool frontend strings are localized into 20+ locales: https://www.transifex.com/mempool/mempool/dashboard/

Translators

  • Arabic @baro0k
  • Czech @pixelmade2
  • Danish @pierrevendelboe
  • German @Emzy
  • English (default)
  • Spanish @maxhodler @bisqes
  • Persian @techmix
  • French @Bayernatoor
  • Korean @kcalvinalvinn @sogoagain
  • Italian @HodlBits
  • Lithuanian @eimze21
  • Hebrew @rapidlab309
  • Georgian @wyd_idk
  • Hungarian @btcdragonlord
  • Dutch @m__btc
  • Japanese @wiz @japananon
  • Norwegian @T82771355
  • Polish @maciejsoltysiak
  • Portugese @jgcastro1985
  • Slovenian @thepkbadger
  • Finnish @bio_bitcoin
  • Swedish @softsimon_
  • Thai @Gusb3ll
  • Turkish @stackmore
  • Ukrainian @volbil
  • Vietnamese @BitcoinvnNews
  • Chinese @wdljt
  • Russian @TonyCrusoe @Bitconan
  • Romanian @mirceavesa
  • Macedonian @SkechBoy
  • Nepalese @kebinm