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

Feat/pre-verification gas module #96

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ LICENSE
README.md
SECURITY.md
CONTRIBUTING.md
CHANGELOG.md

# Tests
test
Expand Down
138 changes: 138 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Changelog

All notable changes to this project will be manually documented in this file by the project maintainers.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - YYYY-MM-DD

### Added

- Support native tracer ([#93](https://github.com/transeptorlabs/transeptor-bundler/pull/93))

### Fixed

- Fix the bug that was causing the pre-verification gas calculation to be too low. ([#92](https://github.com/transeptorlabs/transeptor-bundler/pull/92))

### Changed

- Upgrade to ethers.js [v6.13.4](https://github.com/ethers-io/ethers.js/releases/tag/v6.13.4) ([#92](https://github.com/transeptorlabs/transeptor-bundler/pull/92))

## [v0.7.0-alpha.0] - 2024-11-03

### Added

- Enforces a set of [ERC-7562: Account Abstraction Validation Scope Rules](https://eips.ethereum.org/EIPS/eip-7562)
- Add paymaster deposit manager to enforce EREP-010 ([#82](https://github.com/transeptorlabs/transeptor-bundler/pull/82))
- Enforce `EREP-015` ([#83](https://github.com/transeptorlabs/transeptor-bundler/pull/83))
- Enforce `OP-080` ([#85](https://github.com/transeptorlabs/transeptor-bundler/pull/85))
- Enforce `OP-070` ([#86](https://github.com/transeptorlabs/transeptor-bundler/pull/86))
- Enforce `GREP-010`; drop all userOps from mempool for banned address ([#87](https://github.com/transeptorlabs/transeptor-bundler/pull/87))

### Fixed

- Fixes a set of bugs that were causing the bundler to fail against the [Bundler Compatibility Test Suite](https://github.com/eth-infinitism/bundler-spec-tests)
- Fix bug that was causing bundler to fail `test_stake_check_in_bundler` spec test ([#81](https://github.com/transeptorlabs/transeptor-bundler/pull/81))
- Fix bug that was causing bundler to fail the `replace op` spec test ([#77](https://github.com/transeptorlabs/transeptor-bundler/pull/77))
- Fix the bug that was causing the bundler to fail `max allowed ops unstaked sender` spec test ([#78](https://github.com/transeptorlabs/transeptor-bundler/pull/78))
- Fix bug that was causing bundler to fail `ban_user_op_access_other_ops_sender_in_bundle` spec test ([#79](https://github.com/transeptorlabs/transeptor-bundler/pull/79))

### Changed

- Define a subset of types that only exposes the necessary methods for more granular `MempoolManager` interfaces ([#80](https://github.com/transeptorlabs/transeptor-bundler/pull/80))
- Introduces functional programming paradigm mempool state management to the bundler.

## [v0.6.2-alpha.0] - 2024-06-23

### Changed

- Convert bundler from CommonJS to [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) / ECMAScript.([#65](https://github.com/transeptorlabs/transeptor-bundler/pull/65))

## [v0.6.1-alpha.0] - 2024-04-07

### Fixed

- Update to use ep v7 default address ([#63](https://github.com/transeptorlabs/transeptor-bundler/pull/63))

## [v0.6.0-alpha.0] - 2024-04-07

([#60](https://github.com/transeptorlabs/transeptor-bundler/pull/60))

### Added

- Add support entrypoint v07

### Changed

- Remove mono repo packages
- Remove hardhat and replace with forge
- Update bundler to use node 20.11.1 LTS
- Prefix all environment variables with `TRANSEPTOR` to follow naming best practice.

## [v0.5.3-alpha.0] - 2024-02-19

### Fixed

A bug found in entrypoint v0.6 requires bundlers' attention, and a new test, `test_enough_verification_gas` has been added to the "bundler-spec-test" repo on branch [releases/v0.6](https://github.com/eth-infinitism/bundler-spec-tests/tree/releases/v0.6), PR [here](https://github.com/eth-infinitism/bundler-spec-tests/pull/57) to address the bug.

## [v0.5.2-alpha.0] - 2023-12-16

### Added

Support `Linux/amd64` and `Linux/arm64` OS architectures for transeptor Docker image


## [v0.5.1-alpha.0] - 2023-12-16

### Added

Add Docker image push GitHub workflow

## [v0.5.0-alpha.0] - 2023-10-21

### Added

Add support for metrics and monitoring. Metrics give insight into the bundler node, allowing for performance tuning and debugging. The Transeptor bundler can be configured to store metrics using a push(InfluxDB) and pull(Prometheus) metrics system. Grafana visualizes all the metrics. To run the Transeptor bundler with metrics, enable the `--metrics` flag.

**New ENV:**
`INFLUX_TOKEN=<YOUR_INFLUX_DB_TOKEN>`


**New command line flags:**

| **Options** | **Type** | **Description** | **Default Value** |
| -------------------- | ------- | ------------------------------------------------------------------- | ----------------------- |
| `--metrics` | `boolean` | bundler metrics enabled | `false` |
| `--metricsPort` | `number` | metrics server listening port | `4001` |
| `--influxdbUrl` | `string` | url influxdb is running on | `http://localhost:8086` |
| `--influxdbOrg` | `string` | influxdb org | `transeptor-labs` |
| `--influxdbBucket` | `string` | influxdb bucket | `transeptor_metrics` |

**New endpoint:**
Create a new endpoint running on a separate port to expose collected metrics—`/metrics`. In the future, these metrics will be used to pull metrics with the Prometheus metrics system.

## [v0.4.0-alpha.0] - 2023-09-30

### Changed

- Upgrade Transeptor to a mono repo multiple packages.

## [v0.3.0-alpha.0] - 2023-09-11

### Changed

- Refactor `parseScannerResult` by separating concerns into functions and improving the code readability.

## [v0.2.0-alpha.0] - 2023-09-08

### Changed

- Changed `autoBundleInterval` to 12000ms
- Update JS tracer to pass all opcode banning for [bundler-spec-test](https://github.com/eth-infinitism/bundler-spec-tests/)


## [v0.1.0-alpha.0] - 2023-06-14

- Initial release of Transeptor bundler.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build the source code
FROM node:20-alpine3.18 as build_src
FROM node:20-alpine3.18 AS build_src
WORKDIR /app
RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/*

Expand All @@ -10,11 +10,11 @@ RUN yarn install
RUN yarn build

# Stage 2: Build the dependencies
FROM node:20-alpine3.18 as build_deps
FROM node:20-alpine3.18 AS build_deps
WORKDIR /app
RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/*

ENV NODE_ENV production
ENV NODE_ENV=production

# Copy ./build files from the previous stage
COPY --from=build_src /app/dist ./dist
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
A lightweight, blazing-fast, modular ERC-4337 TypeScript bundler built with functional programming.
A lightweight, blazing-fast, modular ERC-4337 TypeScript bundler built with functional programming
</p>

<p align="center">
Expand All @@ -19,9 +19,9 @@
<img src="https://img.shields.io/docker/pulls/transeptorlabs/bundler" alt="Docker pulls">
</p>

> :warning: **This repository is currently under active development.**
>
> Supports ERC-4337 Entrypoint contract [releases/v0.7](https://github.com/eth-infinitism/account-abstraction/tree/releases/v0.7)
> :warning: **Please note that while the software is fully functional, it is important to know that it may contain bugs and incomplete features and undergo frequent updates.**

- Supports ERC-4337 Entrypoint contract [releases/v0.7](https://github.com/eth-infinitism/account-abstraction/tree/releases/v0.7)

## Prerequisites
- [NodeJS](https://nodejs.org/) (>=20.11.1)
Expand Down Expand Up @@ -67,7 +67,7 @@ yarn lint:fix

Transeptor offers many options for installing and running the bundler node.

## Build from source
### Build from source

Building Transeptor from source requires NodeJS and Yarn. Once you have installed the prerequisites, follow these steps to build Transeptor:
```bash
Expand All @@ -77,10 +77,10 @@ yarn build
./transeptor --help
```

## Docker
### Docker
Quickly get Transeptor running on your machine using Docker.

The following commond will start Transeptor using the latest stable release. Replace `<.path_to_your-env_file>` with the path to your `.env` file and `<http://your_ethererm_network_provider_url>` with the URL of your Ethereum network provider.
The following command will start Transeptor using the latest stable release. Replace `<.path_to_your-env_file>` with the path to your `.env` file and `<http://your_ethererm_network_provider_url>` with the URL of your Ethereum network provider.
```bash
docker run -d --name transeptor -p 4337:4337 --env-file <.path_to_your-env_file> transeptorlabs/bundler:latest \
--httpApi web3,eth,debug \
Expand All @@ -90,7 +90,7 @@ docker run -d --name transeptor -p 4337:4337 --env-file <.path_to_your-env_file>
--auto
```

### Building Docker image
#### Building Docker image

Building the Docker image from the source code requires that the Docker be installed on your machine. Once you have installed Docker, follow these steps to build the Docker image from soruce.

Expand Down
38 changes: 6 additions & 32 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,12 @@
# Security Policy

## Responsible Disclosure Policy
- We only provide support for the [most recent release](https://github.com/transeptorlabs/transeptor-bundler/releases) of our software.
- Please use the latest version to benefit from security patches and updates.

If you have discovered a security vulnerability in any of the nodes provided by Transeptor Labs, we encourage you to report it to us as soon as possible. We are committed to maintaining the security of our systems and appreciate the assistance of the security community.

### Reporting Guidelines

Please follow these guidelines when reporting security vulnerabilities to us:

- Provide a detailed description of the vulnerability, including a clear explanation of the issue and the potential impact.
- If applicable, a proof of concept (PoC) or steps to reproduce the vulnerability.

### Reporting Process

To report a vulnerability, please email [[email protected]](mailto:[email protected]).

Upon receiving your report, we will:

1. Acknowledge the receipt of your report within **3 business days** and provide you with a unique identifier for future reference.
2. Review and investigate the reported issue promptly.
3. Keep you informed of our progress and any necessary updates during the investigation and resolution process.

### Responsible Disclosure Timeline

We appreciate your cooperation in adhering to the following disclosure timeline:

- Please provide us with a reasonable amount of time to investigate and address the reported issue before disclosing any information publicly or sharing it with others. We request a minimum of **10 days** before making any public disclosure.
- We commit to providing an initial response to your report within **10 days** to confirm that we have received your report and are working on the issue.
- We aim to release a patched version or mitigation for the reported vulnerability within **30 days** of the initial contact. This timeline may vary depending on the complexity of the issue. We will keep you updated on our progress.

### Scope

This policy applies to bundler open-source nodes provided by Transeptor Labs.
## Reporting Security Issues

If you discover a security vulnerability in Transeptor, **do not open a public ticket**, as it could put software users at risk before we release a patch for the vulnerability. Please report the issue to [[email protected]](mailto:[email protected]), and we will investigate and address the problem promptly.

## Contact

For any questions or concerns regarding this security policy, don't hesitate to contact us at [[email protected]](mailto:[email protected]).
For any questions or concerns, email [[email protected]](mailto:[email protected]).
1 change: 1 addition & 0 deletions src/gas/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './pre-verification-gas.js'
Loading
Loading