Giter VIP home page Giter VIP logo

bundler's Introduction

ERC-5189 Mempool Bundler

Work in progress

This project is in the early stages of development and is not yet ready for production use.

Feature Status
P2P Sharing of operations โœ… Implemented
Mempool limits (global and per-dependency) โœ… Implemented
Endorser reputation tracking ๐Ÿ”„ Partial
Untrusted env support (see 5189) ๐Ÿ”„ Partial
Simulation settings โœ… Implemented
Archival generation and broadcast โœ… Implemented
Metrics โœ… Implemented
Debug methods fallback to Anvil โœ… Implemented
Embedded sender ๐Ÿ”„ Partial
ERC20 Token fees support ๐Ÿ”„ Partial
Receipt Fetching โŒ Not implemented

Overview

The project is a mempool transaction bundler for general purpose "operations". The project uses ERC-5189 as the reference standard for how the operations are defined and how they should be handled. The project includes a built-in sender, but it is designed to be used with a separate sender (or block builder).

Usage

  1. Create a copy of the /etc/bundler-node.conf.sample file and name it /etc/bundler-1.conf.

  2. (Optional) Generate a random 12-word mnemonic and put it in the mnemonic field in the /etc/bundler-1.conf file.

  3. Define the number of senders to run num_senders in the /etc/bundler-1.conf file.

  4. Run with make run.

Consuming the API

The API can be consumed using the client that can be found in the /proto/client directory. Note that the API is not yet stable and is subject to change.

Additional docs

bundler's People

Contributors

agusx1211 avatar attente avatar pkieltyka avatar screaminghawk avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ayie99969

bundler's Issues

Detect lying endorsers after simulations

An endorser may "lie" in two different ways:

  1. By providing a list of "incomplete" dependencies, this can be detected if an operation goes from valid to invalid while all dependencies remain the same.

  2. By returning ready = true to an operation that does not pay enough fees.


Support for (1) already exists, but (2) is not fully implemented yet.

Right now, the built-in senders simulate the operation before doing the relay; if the simulation pays enough fee, they proceed to execute the operation. If the executed operation didn't pay enough fee, then the endorser may get banned.

But if the simulation says that the operation doesn't pay enough fee, the operation is discarded right away. An additional step must be performed to verify that the endorser is in fact returning ready = false.

This must be done carefully, as there are scenarios in which the sender may decide that the operation does not pay enough, but the endorser may say it does. In these cases, the endorser must not be banned.

i.e., the sender may be asking for a minimum higher priority fee, or for a higher markup on the token fee conversion ratio.

Implement receipt fetching using ERC-X

The following ERC (number not assigned yet):

ethereum/ERCs#318

can be used to optionally allow the bundler to find receipts for the operations. These receipts aren't of much use internally (as they can't directly be trusted), but these capabilities can still be exposed to consumers of the API.

The general idea is:

  • Add an operationReceipt API method.
  • It takes an operation hash and uses IPFS (or the internal mempool) to find the contents of the operation.
  • It uses the ERC to find the receipt.
  • It returns the receipt to the caller.

Include payment token on pubsub topics

All operations are currently being shared using a GossipSub topic ERC5189:pool:op:<chain-id>.

However, ERC-5189 allows operations to natively pay each bundler in any ERC20 token; however, not every bundler is obliged to accept any specific ERC20 token.

This means that some bundlers may ignore many of the messages being shared on the pubsub (if they don't want to accept the token). A better approach could be to use a pubsub topic like this:

ERC5189:pool:op:<payment token>:<chain-id>

Specify ERC-5189 message schema

Right now, ERC-5189 does not specify a message schema for passing operations among peers.

This bundler uses libp2p GossipSub as a temporary solution for this, with peers subscribing to:

ERC5189:pool:op:<chain-id> and ERC5189:pool:archive:<chain-id>, and they pass around JSON marshalled messages. It would be better if either ERC-5189 or some standard could specify how these messages should be passed among peers.

Additionally, it may be worth it to use this opportunity to move to protobuf instead of JSON.

Deploy temporal endorser registry

The project contains a generic "endorser registry" at /registry/registry.go. This endorser registry determines if any endorser should be trusted or not.

Right now, there are two possible sources of information for this registry:

  1. Statically trusted endorsers
  • These endorsers are defined in the configuration and are always trusted. This is directly implemented within the endorser registry.
  1. Contract sources
  • These are contracts that determine if an endorser has "burned" or not.

For quick testing, these validations can be bypassed by (a) adding any wanted endorsers to the list of trusted endorsers or by (b) setting the min_reputation of the registry configuration to zero.


ERC-5189 defines that the endorser registry should be a "burn eth" operation. Given the early stages of development of this ERC, I would recommend allowing a "lighter" version of this mechanic, an endorser registry that instead of burning, enforces that some ETH has been locked for X amount of time. A sample implementation of this can be found at /contracts/src/TemporalRegistry.sol.

This temporal registry should be easy to integrate using the "contract sources" of the endorser registry.

This contract hasn't been deployed and integrated with the rest of the bundler yet.

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.