Skip to content

Commit

Permalink
Feature/grpc execution api (#1)
Browse files Browse the repository at this point in the history
* add buf config and generated grpc code

* poc e2e grpc communication

* comment out panicking code

* logging help

* now reads cli args. now stops grpc server on shutdown.

* add mutex to GRPCServerHandler

update readme

containerize w/ github action to build and push to ghcr (#3)

fix gh action syntax (#4)

* containerize w/ github action to build and push to ghcr

* fix gh action yml syntax

* enable manual trigger

* fix syntax

build and push manually (#5)

* containerize w/ github action to build and push to ghcr

* fix gh action yml syntax

* enable manual trigger

* fix syntax

* dont use github action, do it ourselves

* push manually

Feature/containerize (#6)

* containerize w/ github action to build and push to ghcr

* fix gh action yml syntax

* enable manual trigger

* fix syntax

* dont use github action, do it ourselves

* push manually

* correct multi line

update SubmitTransaction to send tx to metro

ethclient: ensure returned subscription is nil on error (#26976)

core/state, trie: remove Try prefix in Trie accessors (#26975)

This change renames StateTrie methods to remove the Try* prefix.

We added the Trie methods with prefix 'Try' a long time ago, working
around the problem that most existing methods of Trie did not return the
database error. This weird naming convention has persisted until now.

Co-authored-by: Gary Rong <[email protected]>

metrics/librato: ensure resp.body closed (#26969)

This change ensures that we call Close on a http response body, in various places in the source code (mostly tests)

core/vm: use atomic.Bool (#26951)

Make use of new atomic types
---------

Co-authored-by: Felix Lange <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>

core/bloombits: use atomic type (#26993)

core/state: use atomic.Bool (#26992)

graphql: fix data races (#26965)

Fixes multiple data races caused by the fact that resolving fields are done concurrently by the graphql library. It also enforces caching at the stateobject level for account fields.

eth/tracers/native: prevent panic for LOG edge-cases (#26848)

This PR fixes OOM panic in the callTracer as well as panicing on
opcode validation errors (e.g. stack underflow) in callTracer and
prestateTracer.

Co-authored-by: Martin Holst Swende <[email protected]>

internal/debug: add log.logfmt flag to set logging to use logfmt (#26970)

docs: update outdated DeriveSha docs comment (#26968)

add localnet genesis

update metro-transactions dep

Adding features to mempool to support our pre-ordered txs (#2)

* Adding features to mempool to support our pre-ordered txs

* Add framing for gRPC to execute blocks

* Remove public engine API call

* Fix circular dependencies

* Updated to use new Init, and fill out starting attributes

* Add clear astriaordered, cleanup

* readme fix

* add bash and jq to final docker image

* make txpool interface

* no more panics, update DoBlock to also update state + store block

* cleanup

* set post-merge at genesis

* cleanup

* doc update

* remove txpool interface changes

* cleanup

* cleanup

* build and push images wih tags defined by git tags

* build for multiple architectures. use docker-metadata action for semver

* add push: true

* only build arm for git tags/releases

---------

Co-authored-by: Jesse Snyder <[email protected]>
Co-authored-by: elizabeth <[email protected]>

tag image with latest for builds from astria branch (#8)

rename state_root to block_hash

use FROM --platform=$BUILDPLATFORM to build arm images correctly (#9)

use v4 of build and push action (#10)

* use FROM --platform=$BUILDPLATFORM to build arm images correctly

* use v4 of docker build and push

fix arm builds. only build arm for tags and merges to default branch. (#12)

* fix arm builds. only build arm for tags and merges to default branch.

* fix gh action function syntax

* more correct comment

* build for semver tags

Features and fixes needed for contract deployment test (#13)

* add and remove tx from geth mempool so forge can deploy a contract

* pass metro addr and port by flag

* fixes from pr feedback

* formatting

implement FinalizeBlock gRPC call

bump metro-transactions dep

Update Protos (#16)

* uses new protos

* remove old protos

update deps

update deps

no more unknown/unknown image (#19)

* no more unknown/unknown image

* hardcode condition

Changing from prev_state_root to prev_block_hash

remove metro

integrate submission to sequencer

log updates

use env vars for chain id/tendermint endpoint

rename to cometbft

Make the environment variables actually work

cleaner

simple logging change

removed sleep before getPayload by removing goroutine in buildPayload

removed unneeded comment

removed for loop from buildPayload

Remove direct sequencer submission

cleanup go.mod

Migrate to the v1alpha1 API

Missed pieces

set genesis block as head/safe/final

remove all mentions of metro

Initial implementation of Execution v1alpha2 api

Integrate updates

remove need for consensus api

Updates

small updates

Update grpc/execution/server.go

Co-authored-by: noot <[email protected]>

logging

remove unused dependency

Mark the chain 'finalized' on startup
  • Loading branch information
bharath-123 committed May 31, 2024
1 parent e60f991 commit 72b5659
Show file tree
Hide file tree
Showing 10 changed files with 1,950 additions and 202 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/astria-build-and-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflow_dispatch:
push:
branches:
<<<<<<< HEAD
- "main"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
Expand Down Expand Up @@ -34,6 +35,31 @@ jobs:
with:
go-version: "^1.21.x" # The Go version to download (if necessary) and use.
- run: go version
=======
- "astria"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
# trigger on pull request updates when target is `astria` branch
pull_request:
branches:
- "astria"

jobs:
build-and-publish-latest:
runs-on: ubuntu-latest
steps:
# Checking out the repo
- uses: actions/checkout@v3
# Setting up Go
- uses: actions/setup-go@v4
with:
go-version: "^1.20.x" # The Go version to download (if necessary) and use.
- run: go version

>>>>>>> 315c87d76 (Feature/grpc execution api (#1))
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -53,13 +79,23 @@ jobs:
uses: docker/metadata-action@v4
with:
images: |
<<<<<<< HEAD
ghcr.io/astriaorg/astria-geth
tags: |
type=ref,event=pr
type=match,pattern=v(.*),group=1
type=sha
# set latest tag for `astria` branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
=======
ghcr.io/astriaorg/go-ethereum
tags: |
type=ref,event=pr
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=sha
# set latest tag for `astria` branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'astria') }}
>>>>>>> 315c87d76 (Feature/grpc execution api (#1))
- name: Build and push
uses: depot/build-push-action@v1
with:
Expand All @@ -68,7 +104,11 @@ jobs:
provenance: false
context: .
# It takes a long time to build the arm image right now, so we only build it on tags which is what we use for releases, or on merges to the default branch.
<<<<<<< HEAD
platforms: ${{ (contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
=======
platforms: ${{ (contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/astria') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
>>>>>>> 315c87d76 (Feature/grpc execution api (#1))
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
Expand Down
16 changes: 16 additions & 0 deletions core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ type TxPool struct {
term chan struct{} // Termination channel to detect a closed pool

sync chan chan error // Testing / simulator channel to block until internal reset is done

astria *astriaOrdered
}

// New creates a new transaction pool to gather, sort and filter inbound
Expand Down Expand Up @@ -521,3 +523,17 @@ func (p *TxPool) Sync() error {
return errors.New("pool already terminated")
}
}

type astriaOrdered struct {
txs types.Transactions
}

func newAstriaOrdered(txs types.Transactions) *astriaOrdered {
return &astriaOrdered{
txs: txs,
}
}

func (ao *astriaOrdered) clear() {
ao.txs = *&types.Transactions{}
}
10 changes: 3 additions & 7 deletions grpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ This package provides a gRPC server as an entrypoint to the EVM.

## Build and run from source:

```bash
# install necessary dependencies
brew install leveldb

# build geth
make geth
```
See [private_network.md](../private_network.md) for running a local geth node.
### Running with remote Docker image:
<<<<<<< HEAD
=======
>>>>>>> 315c87d76 (Feature/grpc execution api (#1))
```bash
docker run --rm \
-p 8545:8545 -p 30303:30303 -p 50051:50051 \
Expand All @@ -24,7 +21,6 @@ docker run --rm \
```

### Local Docker workflow:

```bash
# build local docker image
docker build \
Expand Down
22 changes: 22 additions & 0 deletions grpc/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# buf.gen.yaml
version: v1
managed:
enabled: true
go_package_prefix:
# <module_name> : name in go.mod
# <relative_path> : where generated code should be output
# default: <module_name>/<relative_path>
default: github.com/ethereum/go-ethereum/grpc
# Remove `except` field if googleapis is not used
# except:
# - buf.build/googleapis/googleapis
plugins:
- plugin: buf.build/grpc/go
out: gen
opt:
- paths=source_relative
# dependencies
- plugin: buf.build/protocolbuffers/go
out: gen
opt:
- paths=source_relative
Loading

0 comments on commit 72b5659

Please sign in to comment.