Code Monkey home page Code Monkey logo

blockbuilding's Introduction

Hi there ๐Ÿ‘‹

I'm Murch. I work on Bitcoin-related projects at Chaincode Labs.

blockbuilding's People

Contributors

clarashk avatar murchandamus avatar ottoallmendinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blockbuilding's Issues

Create and use global allowlist for pruning mempools

We only use transactions that were eventually included in the blockchain as it is otherwise hard to impossible to get all relevant meta data. Currently, mempools are pruned per the allowlist created from the transactions that occurred in the same month. If we instead used an allowlist created from all months this would give our blockbuilders a bigger set of transactions to work with, especially towards the end of a month when the mempool is not empty.

A simple approach would be to also include the transactions from blocks until the next time the mempool fully cleared after the end of the month. A more comprehensive approach would be to train a cuckoo filter on all transactions confirmed starting with the first month we consider and use that as a replacement of an allowlist explicitly encompassing all transactions.

Backfill relatives only on demand

Keep all transactions sorted by feerate, and only backfill the ancestry when the individual transactions become relevant per their feerate. When backfilling ancestors, also register all relevant children and descendants from the currently observed transaction set to the whole set.

Effect: Instead of processing the whole transaction set and backfilling all transactions even when some will never be considered for blockbuilding, this will only do the graph traversals for transactions relevant to the selection process. Could improve processing performance if we do a lot more simulations.

Perform clustering lazily

Currently, all transactions are clustered after they're loaded by the candidate-set-based blockbuilder. If we were to run a lot more simulations, it would probably be more performant if transactions were only clustered on demand. All transactions would be sorted by feerate, and while there is a transaction with a higher individual feerate than the best candidate set of the current cluster, that transaction would get clustered to potentially discover a better candidate set.

This should allow the blockbuilder to forgo clustering of most transactions when the mempool is very full, but since any transaction that individually has a higher feerate would cause itself and all of its ancestors to get clustered, any transactions that pay a higher feerate than the current best candidate set would have had to been considered before, and therefore we should expect to have the best candidate set globally even while lazily evaluating clusters.

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.