Skip to content

fix delegate caller address, advertise as fh2.1 #3

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

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e565f5c
deep-mind: add computed TotalDifficulty field to END_BLOCK
sduchesneau Apr 20, 2022
6a3a2b0
Add output of deepmind version as DMLOG
sduchesneau Apr 21, 2022
3cd448c
add total ordering counter to all events
sduchesneau Apr 21, 2022
1bd51a6
adjust/revert some dmlog events not requiring total ordering
sduchesneau Apr 22, 2022
ab7a6a6
adjust INIT dmlog output to be single-line, adjust README.fh.md
sduchesneau Apr 22, 2022
93732a4
Merge branch 'firehose-v1' into firehose-v2
maoueh Apr 26, 2022
d1cba09
Added missing elements in BEGIN_APPLY_TRX to work with console reader…
maoueh Apr 27, 2022
14c5fd9
Merge branch 'firehose-v1' into firehose-v2
maoueh Apr 27, 2022
808a287
Fixed new required params
maoueh Apr 27, 2022
703917a
Merge branch 'firehose-v1' into firehose-v2
maoueh Apr 27, 2022
fc12d4b
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Apr 28, 2022
91fa8f8
Removed GasEvent from v2 format
maoueh Apr 28, 2022
a8134fa
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Apr 28, 2022
5756d3a
Added AccessList and MaxPriorityGasFee to start transaction message
maoueh Apr 29, 2022
f88a2d4
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Apr 29, 2022
ddd5757
Added serialization of AccessList
maoueh Apr 29, 2022
b65dd26
Improved firehose robustness now in presence of new transactions' types
maoueh Apr 29, 2022
c757147
Adjusted a bit comments and code location
maoueh Apr 29, 2022
04640a3
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Apr 29, 2022
620425f
Merge branch 'firehose-v1' into firehose-v2
maoueh Apr 29, 2022
dc756b3
Merge branch 'firehose-v1-v1.10.1' into firehose-v2-v1.10.1
maoueh Apr 29, 2022
129e032
Merge branch 'firehose-v1-v1.10.1' into firehose-v2-v1.10.1
maoueh Apr 29, 2022
388ad0a
Improved error handling of bad transaction's type
maoueh Apr 29, 2022
cfbde93
Added genesis block recording
maoueh Apr 30, 2022
4b402c6
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Apr 30, 2022
dbf3576
Fixed genesis recording, must output the allocation sorted to ensure …
maoueh Apr 30, 2022
a52746d
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Apr 30, 2022
1136475
Turned error into panic when genesis block mistmatch to surface the e…
maoueh Apr 30, 2022
6682e6e
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Apr 30, 2022
ba4bfee
Merge branch 'firehose-v1' into firehose-v2
maoueh May 2, 2022
bc0624a
Adjusted -latest-fh1 to -latest-fh2
maoueh May 2, 2022
f5d3586
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh May 2, 2022
030800a
Merge branch 'firehose-v1-v1.10.1' into firehose-v2-v1.10.1
maoueh May 2, 2022
c4dae69
Merge branch 'firehose-v1-v1.10.1' into firehose-v2-v1.10.1
maoueh May 3, 2022
dbf7d76
Merge branch 'firehose-v1-v1.10.1' into firehose-v2-v1.10.1
maoueh May 3, 2022
671a159
Merge branch 'firehose-v1-v1.10.1' into firehose-v2-v1.10.1
maoueh May 3, 2022
d0dfc38
Removed deep-mind in favor of Firehose
maoueh Sep 1, 2022
3904d0d
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Sep 1, 2022
2fdef8b
Fixed some missing deep mind change
maoueh Sep 1, 2022
17ba9fd
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Sep 1, 2022
840c912
fix pre-Homestead bug: failed account creation transactions actually …
sduchesneau Jul 25, 2022
6560224
fix deepmind skipping KnownBlock
sduchesneau Aug 15, 2022
425de20
Adjusted usage of deepmind to firehose
maoueh Sep 1, 2022
b9f0527
Merge branch 'firehose-v2' into firehose-v2-v1.10.1
maoueh Sep 1, 2022
ef46ace
fix delegate caller to be parent address instead of parent's caller a…
sduchesneau Oct 19, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# 2 docker tags: `{geth|bsc|...}-latest` and `{git-tag}`
tags: |
type=ref,event=tag,priority=1000
type=match,pattern=^(.*)-v,group=1,suffix=-latest-fh1
type=match,pattern=^(.*)-v,group=1,suffix=-latest-fh2
flavor: |
latest=false

Expand Down
132 changes: 0 additions & 132 deletions README.dfuse.md

This file was deleted.

12 changes: 6 additions & 6 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/deepmind"
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/firehose"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
Expand Down Expand Up @@ -423,7 +423,7 @@ func (b *SimulatedBackend) PendingNonceAt(ctx context.Context, account common.Ad
b.mu.Lock()
defer b.mu.Unlock()

return b.pendingState.GetOrNewStateObject(account, false, deepmind.NoOpContext).Nonce(), nil
return b.pendingState.GetOrNewStateObject(account, false, firehose.NoOpContext).Nonce(), nil
}

// SuggestGasPrice implements ContractTransactor.SuggestGasPrice. Since the simulated
Expand Down Expand Up @@ -539,19 +539,19 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
call.Value = new(big.Int)
}
// Set infinite balance to the fake caller account.
from := stateDB.GetOrNewStateObject(call.From, false, deepmind.NoOpContext)
from.SetBalance(math.MaxBig256, deepmind.NoOpContext, deepmind.IgnoredBalanceChangeReason)
from := stateDB.GetOrNewStateObject(call.From, false, firehose.NoOpContext)
from.SetBalance(math.MaxBig256, firehose.NoOpContext, firehose.IgnoredBalanceChangeReason)
// Execute the call.
msg := callMsg{call}

txContext := core.NewEVMTxContext(msg)
evmContext := core.NewEVMBlockContext(block.Header(), b.blockchain, nil)
// Create a new environment which holds all relevant information
// about the transaction and calling mechanisms.
vmEnv := vm.NewEVM(evmContext, txContext, stateDB, b.config, vm.Config{}, deepmind.NoOpContext)
vmEnv := vm.NewEVM(evmContext, txContext, stateDB, b.config, vm.Config{}, firehose.NoOpContext)
gasPool := new(core.GasPool).AddGas(math.MaxUint64)

return core.NewStateTransition(vmEnv, msg, gasPool, deepmind.NoOpContext).TransitionDb()
return core.NewStateTransition(vmEnv, msg, gasPool, firehose.NoOpContext).TransitionDb()
}

// SendTransaction updates the pending block to include the given transaction.
Expand Down
2 changes: 1 addition & 1 deletion cmd/devp2p/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func init() {
// Set up the CLI app.
app.Flags = append(app.Flags, debug.Flags...)
app.Before = func(ctx *cli.Context) error {
return debug.Setup(ctx)
return debug.Setup(ctx, nil)
}
app.After = func(ctx *cli.Context) error {
debug.Exit()
Expand Down
18 changes: 9 additions & 9 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/deepmind"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/firehose"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
Expand Down Expand Up @@ -126,7 +126,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
if chainConfig.DAOForkSupport &&
chainConfig.DAOForkBlock != nil &&
chainConfig.DAOForkBlock.Cmp(new(big.Int).SetUint64(pre.Env.Number)) == 0 {
misc.ApplyDAOHardFork(statedb, deepmind.NoOpContext)
misc.ApplyDAOHardFork(statedb, firehose.NoOpContext)
}

for i, tx := range txs {
Expand All @@ -145,7 +145,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
statedb.Prepare(tx.Hash(), blockHash, txIndex)
txContext := core.NewEVMTxContext(msg)
snapshot := statedb.Snapshot()
evm := vm.NewEVM(vmContext, txContext, statedb, chainConfig, vmConfig, deepmind.NoOpContext)
evm := vm.NewEVM(vmContext, txContext, statedb, chainConfig, vmConfig, firehose.NoOpContext)

// (ret []byte, usedGas uint64, failed bool, err error)
msgResult, err := core.ApplyMessage(evm, msg, gaspool)
Expand Down Expand Up @@ -219,9 +219,9 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
reward.Sub(reward, big.NewInt(0).SetUint64(ommer.Delta))
reward.Mul(reward, blockReward)
reward.Div(reward, big.NewInt(8))
statedb.AddBalance(ommer.Address, reward, false, deepmind.NoOpContext, deepmind.IgnoredBalanceChangeReason)
statedb.AddBalance(ommer.Address, reward, false, firehose.NoOpContext, firehose.IgnoredBalanceChangeReason)
}
statedb.AddBalance(pre.Env.Coinbase, minerReward, false, deepmind.NoOpContext, deepmind.IgnoredBalanceChangeReason)
statedb.AddBalance(pre.Env.Coinbase, minerReward, false, firehose.NoOpContext, firehose.IgnoredBalanceChangeReason)
}
// Commit block
root, err := statedb.Commit(chainConfig.IsEIP158(vmContext.BlockNumber))
Expand All @@ -245,11 +245,11 @@ func MakePreState(db ethdb.Database, accounts core.GenesisAlloc) *state.StateDB
sdb := state.NewDatabase(db)
statedb, _ := state.New(common.Hash{}, sdb, nil)
for addr, a := range accounts {
statedb.SetCode(addr, a.Code, deepmind.NoOpContext)
statedb.SetNonce(addr, a.Nonce, deepmind.NoOpContext)
statedb.SetBalance(addr, a.Balance, deepmind.NoOpContext, deepmind.IgnoredBalanceChangeReason)
statedb.SetCode(addr, a.Code, firehose.NoOpContext)
statedb.SetNonce(addr, a.Nonce, firehose.NoOpContext)
statedb.SetBalance(addr, a.Balance, firehose.NoOpContext, firehose.IgnoredBalanceChangeReason)
for k, v := range a.Storage {
statedb.SetState(addr, k, v, deepmind.NoOpContext)
statedb.SetState(addr, k, v, firehose.NoOpContext)
}
}
// Commit and re-open to start with a clean state.
Expand Down
6 changes: 3 additions & 3 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/core/vm/runtime"
"github.com/ethereum/go-ethereum/deepmind"
"github.com/ethereum/go-ethereum/firehose"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"gopkg.in/urfave/cli.v1"
Expand Down Expand Up @@ -147,7 +147,7 @@ func runCmd(ctx *cli.Context) error {
if ctx.GlobalString(SenderFlag.Name) != "" {
sender = common.HexToAddress(ctx.GlobalString(SenderFlag.Name))
}
statedb.CreateAccount(sender, deepmind.NoOpContext)
statedb.CreateAccount(sender, firehose.NoOpContext)

if ctx.GlobalString(ReceiverFlag.Name) != "" {
receiver = common.HexToAddress(ctx.GlobalString(ReceiverFlag.Name))
Expand Down Expand Up @@ -258,7 +258,7 @@ func runCmd(ctx *cli.Context) error {
}
} else {
if len(code) > 0 {
statedb.SetCode(receiver, code, deepmind.NoOpContext)
statedb.SetCode(receiver, code, firehose.NoOpContext)
}
execFunc = func() ([]byte, uint64, error) {
return runtime.Call(receiver, input, &runtimeConfig)
Expand Down
2 changes: 1 addition & 1 deletion cmd/geth/accountcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Path of the secret key file: .*UTC--.+--[0-9a-f]{40}
}

func TestAccountImport(t *testing.T) {
t.Skip("broken in deep mind, not really important for proper syncing so disabled for now")
t.Skip("broken in firehose, not really important for proper syncing so disabled for now")

tests := []struct{ name, key, output string }{
{
Expand Down
17 changes: 12 additions & 5 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ import (
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/firehose"
"github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/internal/flags"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params"
gopsutil "github.com/shirou/gopsutil/mem"
"gopkg.in/urfave/cli.v1"
)
Expand Down Expand Up @@ -244,16 +246,21 @@ func init() {
app.Flags = append(app.Flags, rpcFlags...)
app.Flags = append(app.Flags, consoleFlags...)
app.Flags = append(app.Flags, debug.Flags...)
app.Flags = append(app.Flags, debug.DeepMindFlags...)
app.Flags = append(app.Flags, debug.FirehoseFlags...)
app.Flags = append(app.Flags, metricsFlags...)

app.Before = func(ctx *cli.Context) error {
// Force sync mode to `full` for deep mind code (whatever the value flag!)
if err := ctx.GlobalSet(utils.SyncModeFlag.Name, "full"); err != nil {
log.Error("deep mind failed to set sync mode to full", err)
if err := debug.Setup(ctx, utils.MakeGenesis(ctx)); err != nil {
return err
}

return debug.Setup(ctx)
firehose.MaybeSyncContext().InitVersion(
params.VersionWithCommit(gitCommit, gitDate),
params.FirehoseVersion(),
params.Variant,
)

return nil
}
app.After = func(ctx *cli.Context) error {
debug.Exit()
Expand Down
4 changes: 2 additions & 2 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ var AppHelpFlagGroups = []flags.FlagGroup{
},
},
{
Name: "DEEP MIND",
Flags: debug.DeepMindFlags,
Name: "FIREHOSE",
Flags: debug.FirehoseFlags,
},
}

Expand Down
8 changes: 4 additions & 4 deletions consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/deepmind"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/firehose"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
Expand Down Expand Up @@ -547,17 +547,17 @@ func (c *Clique) Prepare(chain consensus.ChainHeaderReader, header *types.Header

// Finalize implements consensus.Engine, ensuring no uncles are set, nor block
// rewards given.
func (c *Clique) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, dmContext *deepmind.Context) {
func (c *Clique) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, firehoseContext *firehose.Context) {
// No block rewards in PoA, so the state remains as is and uncles are dropped
header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
header.UncleHash = types.CalcUncleHash(nil)
}

// FinalizeAndAssemble implements consensus.Engine, ensuring no uncles are set,
// nor block rewards given, and returns the final block.
func (c *Clique) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt, dmContext *deepmind.Context) (*types.Block, error) {
func (c *Clique) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt, firehoseContext *firehose.Context) (*types.Block, error) {
// Finalize block
c.Finalize(chain, header, state, txs, uncles, dmContext)
c.Finalize(chain, header, state, txs, uncles, firehoseContext)

// Assemble and return the final block for sealing
return types.NewBlock(header, txs, nil, receipts, trie.NewStackTrie(nil)), nil
Expand Down
6 changes: 3 additions & 3 deletions consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/deepmind"
"github.com/ethereum/go-ethereum/firehose"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
)
Expand Down Expand Up @@ -88,15 +88,15 @@ type Engine interface {
// Note: The block header and state database might be updated to reflect any
// consensus rules that happen at finalization (e.g. block rewards).
Finalize(chain ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction,
uncles []*types.Header, dmContext *deepmind.Context)
uncles []*types.Header, firehoseContext *firehose.Context)

// FinalizeAndAssemble runs any post-transaction state modifications (e.g. block
// rewards) and assembles the final block.
//
// Note: The block header and state database might be updated to reflect any
// consensus rules that happen at finalization (e.g. block rewards).
FinalizeAndAssemble(chain ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction,
uncles []*types.Header, receipts []*types.Receipt, dmContext *deepmind.Context) (*types.Block, error)
uncles []*types.Header, receipts []*types.Receipt, firehoseContext *firehose.Context) (*types.Block, error)

// Seal generates a new sealing request for the given input block and pushes
// the result into the given channel.
Expand Down
Loading