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: Trusted Builder with Optimistic Simulation MVP #41

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ type BlockChain struct {
currentSnapBlock atomic.Pointer[types.Header] // Current head of snap-sync
currentFinalBlock atomic.Pointer[types.Header] // Latest (consensus) finalized block
currentSafeBlock atomic.Pointer[types.Header] // Latest (consensus) safe block
currentTempBlock atomic.Pointer[types.Header] // Latest block executed via ExecuteBlock

currentBaseCelestiaHeight atomic.Uint64 // Latest finalized block height on Celestia

Expand Down Expand Up @@ -323,6 +324,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis

bc.currentSnapBlock.Store(nil)
bc.currentBlock.Store(bc.genesisBlock.Header())
bc.currentTempBlock.Store(bc.genesisBlock.Header())
bc.currentFinalBlock.Store(bc.genesisBlock.Header())
bc.currentSafeBlock.Store(bc.genesisBlock.Header())
bc.currentBaseCelestiaHeight.Store(bc.Config().AstriaCelestiaInitialHeight)
Expand Down Expand Up @@ -639,6 +641,10 @@ func (bc *BlockChain) SetSafe(header *types.Header) {
}
}

func (bc *BlockChain) SetTemp(header *types.Header) {
bc.currentTempBlock.Store(header)
}

// rewindHashHead implements the logic of rewindHead in the context of hash scheme.
func (bc *BlockChain) rewindHashHead(head *types.Header, root common.Hash) (*types.Header, uint64) {
var (
Expand Down
4 changes: 4 additions & 0 deletions core/blockchain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func (bc *BlockChain) CurrentSafeBlock() *types.Header {
return bc.currentSafeBlock.Load()
}

func (bc *BlockChain) CurrentTempBlock() *types.Header {
return bc.currentTempBlock.Load()
}

// CurrentBaseCelestiaHeight retrieves the current base celestia height of the
// canonical chain. The height is retrieved from the blockchain's internal cache.
func (bc *BlockChain) CurrentBaseCelestiaHeight() uint64 {
Expand Down
3 changes: 3 additions & 0 deletions core/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,7 @@ var (

// ErrBlobTxCreate is returned if a blob transaction has no explicit to field.
ErrBlobTxCreate = errors.New("blob transaction of type create")

// ErrTxReverted is returned if a transaction is reverted.
ErrTxReverted = errors.New("transaction reverted")
)
7 changes: 3 additions & 4 deletions eth/tracers/live/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ func (t *noop) OnTxStart(vm *tracing.VMContext, tx *types.Transaction, from comm
}

func (t *noop) OnTxEnd(receipt *types.Receipt, err error) {
}

func (t *noop) OnBlockStart(ev tracing.BlockEvent) {
}

func (t *noop) OnBlockEnd(err error) {
}
func (t *noop) OnBlockStart(ev tracing.BlockEvent) {}

func (t *noop) OnBlockEnd(err error) {}

func (t *noop) OnSkippedBlock(ev tracing.BlockEvent) {}

Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module github.com/ethereum/go-ethereum
go 1.21

require (
buf.build/gen/go/astria/execution-apis/grpc/go v1.4.0-20240627184145-202c666b5a8a.2
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.2-20240723183210-193b02425a52.2
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240723183210-d00b2a17ea5b.2
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-20240723183210-414756da3320.2
buf.build/gen/go/astria/composer-apis/protocolbuffers/go v1.34.2-00000000000000-bf2928746fde.2
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-cdc3a35f6a0c.1
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.2-20240801092317-cdc3a35f6a0c.2
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240807170122-b074164339d1.2
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-20240807170122-24ff5bcd4581.2
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0
github.com/Microsoft/go-winio v0.6.1
github.com/VictoriaMetrics/fastcache v1.12.1
Expand Down Expand Up @@ -72,21 +73,20 @@ require (
github.com/tyler-smith/go-bip39 v1.1.0
github.com/urfave/cli/v2 v2.25.7
go.uber.org/automaxprocs v1.5.2
golang.org/x/crypto v0.22.0
golang.org/x/crypto v0.24.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.19.0
golang.org/x/text v0.14.0
golang.org/x/sys v0.21.0
golang.org/x/text v0.16.0
golang.org/x/time v0.5.0
golang.org/x/tools v0.20.0
google.golang.org/grpc v1.64.0
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
google.golang.org/grpc v1.64.1
google.golang.org/protobuf v1.34.2
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v3 v3.0.1
)

require (
buf.build/gen/go/astria/protocol-apis/grpc/go v1.4.0-00000000000000-71710707f61c.2 // indirect
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.2-20240723183210-71710707f61c.2 // indirect
buf.build/gen/go/astria/composer-apis/grpc/go v1.4.0-20240528191859-5569d2ee7204.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/DataDog/zstd v1.4.5 // indirect
Expand Down Expand Up @@ -151,7 +151,7 @@ require (
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/net v0.26.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading
Loading