Fork of plugeth with any needed changes for statediff plugin
Go to file
2021-07-14 08:33:17 -05:00
.github github: add note about screenshots in issue template (#22764) 2021-04-29 19:30:37 +02:00
accounts accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038) 2021-06-15 13:56:14 +03:00
build travis, build: own docker builder and hub pusher 2021-06-17 11:04:57 +03:00
cmd Add state update hooks 2021-07-12 14:45:42 -05:00
common common: rename unused function with typo (#23025) 2021-06-10 10:53:23 +03:00
consensus accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038) 2021-06-15 13:56:14 +03:00
console eth: move eth.Config to a common package (#22205) 2021-02-05 13:51:15 +01:00
contracts/checkpointoracle accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038) 2021-06-15 13:56:14 +03:00
core Hooks for appending ancients, initial work on block update plugin 2021-07-14 08:33:17 -05:00
crypto crypto/secp256k1: fix undefined behavior in BitCurve.Add (#22621) 2021-05-27 13:30:25 +02:00
docs/audits docs/audits: add discv5 protocol audits from LA and C53 (#20898) 2020-04-07 12:15:28 +02:00
eth Add tracing for live blocks, replace readme 2021-06-28 12:11:38 -05:00
ethclient accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038) 2021-06-15 13:56:14 +03:00
ethdb core, eth, ethdb, trie: simplify range proofs 2021-04-29 10:59:08 +03:00
ethstats ethstats: fix typo in comment (#22952) 2021-05-26 22:33:00 +02:00
event event: add ResubscribeErr (#22191) 2021-01-21 13:47:38 +01:00
graphql core, graphql, internal: expose effectiveGasPrice in receipts 2021-06-16 09:52:06 +03:00
internal core, graphql, internal: expose effectiveGasPrice in receipts 2021-06-16 09:52:06 +03:00
les accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038) 2021-06-15 13:56:14 +03:00
light accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038) 2021-06-15 13:56:14 +03:00
log log: fix formatting of big.Int (#22679) 2021-04-16 09:27:16 +03:00
metrics metrics: use golang.org/x/sys/unix to support Solaris (#22584) 2021-06-01 10:50:54 +02:00
miner accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038) 2021-06-15 13:56:14 +03:00
mobile eth: move eth.Config to a common package (#22205) 2021-02-05 13:51:15 +01:00
node internal/web3ext, node: migrate node admin API (Start|Stop)RPC->HTTP (#22461) 2021-03-23 11:41:23 +02:00
p2p p2p/msgrate: return capacity as integer, clamp to max uint32 (#22943) 2021-05-27 19:43:55 +03:00
params params: release go-ethereum v1.10.4 stable 2021-06-17 12:35:17 +02:00
plugins Hooks for appending ancients, initial work on block update plugin 2021-07-14 08:33:17 -05:00
rlp p2p/rlpx: reduce allocation and syscalls (#22899) 2021-05-27 10:19:13 +02:00
rpc rpc: add HTTPError type for HTTP error responses (#22677) 2021-04-21 15:51:30 +02:00
signer cmd/clef, signer: support for eip-1559 txs in clef (#22966) 2021-06-09 13:48:47 +02:00
swarm swarm: code cleanup, move to ethersphere/swarm (#19661) 2019-06-04 16:35:36 +03:00
tests Plugin Interface Refactor 2021-06-25 10:57:56 -05:00
trie trie: remove the duplicate batch-write for 'preimage' (#23001) 2021-06-07 09:11:07 +02:00
.dockerignore cmd, internal/build, docker: advertise commit date in unstable build versions (#19522) 2019-05-08 16:44:28 +03:00
.gitattributes .gitattributes: enable solidity highlighting on github (#16425) 2018-04-03 15:21:24 +02:00
.gitignore build: use golangci-lint (#20295) 2019-11-18 10:49:17 +02:00
.gitmodules tests: update tests and implement general state tests (#14734) 2017-07-11 13:49:14 +02:00
.golangci.yml build: upgrade to golangci lint v1.27.0 (#21127) 2020-05-26 14:24:22 +03:00
.mailmap all: update license information (#16089) 2018-02-14 13:49:11 +01:00
.travis.yml travis: don't overwrite amd64 images with arm64 2021-06-17 12:22:22 +03:00
appveyor.yml appveyor.yml: upgrade to VisualStudio 2019 image (#22811) 2021-05-04 23:39:09 +03:00
AUTHORS build: deduplicate same authors with different casing 2019-07-22 12:31:11 +03:00
circle.yml circleci: enable docker based hive testing 2016-07-15 16:07:34 +03:00
COPYING COYPING: restore the full text text of GPL (#21568) 2020-09-15 08:27:17 +02:00
COPYING.LESSER all: update license information 2015-07-07 14:12:44 +02:00
Dockerfile Dockerfile: bump to Go 1.16 base images 2021-02-23 18:28:24 +02:00
Dockerfile.alltools Dockerfile: bump to Go 1.16 base images 2021-02-23 18:28:24 +02:00
go.mod go.mod: upgrade to fastcache v1.6.0 (#22982) 2021-06-08 10:39:05 +02:00
go.sum go.mod: upgrade to fastcache v1.6.0 (#22982) 2021-06-08 10:39:05 +02:00
interfaces.go all: rename internal 1559 gas fields, add support for graphql (#23010) 2021-06-08 12:05:41 +02:00
Makefile build: improve cross compilation setup (#22804) 2021-05-04 13:01:20 +02:00
oss-fuzz.sh crypto/secp256k1: fix undefined behavior in BitCurve.Add (#22621) 2021-05-27 13:30:25 +02:00
README.md Readme grammar 2021-06-30 08:49:27 -05:00
SECURITY.md SECURITY.md: link to release page (#22067) 2021-01-04 12:42:47 +01:00

PluGeth

PluGeth is a fork of the Go Ethereum Client (Geth) that implements a plugin architecture, allowing developers to extend Geth's capabilities in a number of different ways using plugins, rather than having to create additional, new forks of Geth.

WARNING: UNSTABLE API

Right now PluGeth is in early development. We are still settling on some of the plugin APIs, and are not yet making official releases. From an operational perspective, PluGeth should be as stable as upstream Geth less whatever instability is added by plugins you might run. But if you plan to run PluGeth today, be aware that future updates will likely break your plugins.

System Requirements

System requirements will vary depending on which network you are connecting to. On the Ethereum mainnet, you should have at least 8 GB RAM, 2 CPUs, and 350 GB of SSD disks.

PluGeth relies on Golang's Plugin implementation, which is only supported on Linux, FreeBSD, and macOS. Windows support is unlikely to be added in the foreseeable future.

Design Goals

The upstream Geth client exists primarily to serve as a client for the Ethereum mainnet, though it also supports a number of popular testnets. Supporting the Ethereum mainnet is a big enough challenge in its own right that the Geth team generally avoids changes to support other networks, or to provide features only a small handful of users would be interested in.

The result is that many projects have forked Geth. Some implement their own consensus protocols or alter the behavior of the EVM to support other networks. Others are designed to extract information from the Ethereum mainnet in ways the standard Geth client does not support.

Creating numerous different forks to fill a variety of different needs comes with a number of drawbacks. Forks tend to drift apart from each other. Many networks that forked from Geth long ago have stopped merging updates from Geth; this makes some sense, given that those networks have moved in different directions than Geth and merging upstream changes while properly maintaining consensus rules of an existing network could prove quite challenging. But not merging changes from upstream can mean that security updates are easily missed, especially when the upstream team obscures security updates as optimizations as a matter of process.

PluGeth aims to provide a single Geth fork that developers can choose to extend rather than forking the Geth project. Out of the box, PluGeth behaves exactly like upstream Geth, but by installing plugins written in Golang, developers can extend its functionality in a wide variety of way.

Anatomy of a Plugin

Plugins for Plugeth use Golang's Native Plugin System. Plugin modules must export variables using specific names and types. These will be processed by the plugin loader, and invoked at certain points during Geth's operations.

API

Flags

  • Name: Flags
  • Type: flag.FlagSet
  • Behavior: This FlagSet will be parsed and your plugin will be able to access the resulting flags. Note that if any flags are provided, certain checks are disabled within Geth to avoid failing due to unexpected flags.

Subcommands

  • Name: Subcommands
  • Type: map[string]func(ctx *cli.Context, args []string) error
  • Behavior: If Geth is invoked with geth YOUR_COMMAND, the plugin loader will look for YOUR_COMMAND within this map, and invoke the corresponding function. This can be useful for certain behaviors like manipulating Geth's database without having to build a separate binary.

Tracers

  • Name: Tracer
  • Type: map[string]TracerResult
  • Behavior: When calling debug.traceX functions (such as debug_traceCall and debug_traceTransaction) the tracer can be specified as a key to this map and the tracer used will be the TracerResult specified here. TracerResult objects must match the interface:
// CaptureStart is called at the start of each transaction
CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) {
// CaptureState is called for each opcode
CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) {
// CaptureFault is called when an error occurs in the EVM
CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error) {
// CaptureEnd is called at the end of each transaction
CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) {
// GetResult should return a JSON serializable result object to respond to the trace call
GetResult() (interface{}, error) {

  • Caution: Modifying of the values passed into tracer functions can alter the results of the EVM execution in unpredictable ways. Additionally, some objects may be reused across calls, so data you wish to capture should be copied rather than retained by reference.

LiveTracer

  • Name: LiveTracer
  • Type: vm.Tracer
  • Behavior: This tracer is used for tracing transactions as they are processed within blocks. Note that if a block does not validate, some transactions may be processed that don't end up in blocks, so be sure to check transactions against finalized blocks.

The interface for a vm.Tracer is similar to a TracerResult (above), but does not require a GetResult() function.

Extending The Plugin API

While we can imagine lots of ways plugins might like to extract or change information in Geth, we're trying not to go too crazy with the plugin API based purely on hypotheticals. The Plugin API in its current form reflects the needs of projects currently building on PluGeth, and we're happy to extend it for people who are building something. If you're trying to do something that isn't supported by the current plugin system, we're happy to help. Reach out to us on Discord and we'll help you figure out how to make it work.