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: firehose live tracer #53

Draft
wants to merge 33 commits into
base: feature/erigon-live-tracer-port
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ae0e05e
firehose tracer added
dhyaniarun1993 Oct 30, 2023
efa194d
fix bugs
dhyaniarun1993 Nov 2, 2023
cecd3b4
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Nov 2, 2023
bdf5917
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Nov 6, 2023
889f8be
feature/erigon-live-tracer-port merged
dhyaniarun1993 Nov 6, 2023
3029efe
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Nov 6, 2023
73931ad
refactor
dhyaniarun1993 Nov 6, 2023
6766b46
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Nov 7, 2023
dfcc4d0
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Nov 28, 2023
983a37e
bugfixes
dhyaniarun1993 Nov 28, 2023
c55a05e
code refactor
dhyaniarun1993 Dec 6, 2023
c06028c
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Dec 11, 2023
ad989aa
account creation backward compatibility
dhyaniarun1993 Dec 12, 2023
be910c9
executed code corner case
dhyaniarun1993 Dec 12, 2023
fa85b27
topic backward compatibility fix
dhyaniarun1993 Dec 13, 2023
1251baf
revert: topic backward compatibility fix
dhyaniarun1993 Dec 13, 2023
4bb66cd
feature/erigon-live-tracer-port merged
dhyaniarun1993 Jan 10, 2024
ff0e93a
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Jan 11, 2024
88715da
remove delegate value hack
dhyaniarun1993 Jan 11, 2024
d37c193
fix comment
dhyaniarun1993 Feb 12, 2024
5a3c874
erigon tracer merged and conflict resolved
dhyaniarun1993 Feb 13, 2024
2741e7e
Updated when FIRE INIT is actually printed
dhyaniarun1993 Feb 13, 2024
36d5bf0
feature/erigon-live-tracer-port merged
dhyaniarun1993 Feb 16, 2024
9705550
merge code fixes
dhyaniarun1993 Feb 16, 2024
6bbe0a3
Reduce amount of changes to Geth Live Tracer to keep Firehose backwar…
dhyaniarun1993 Feb 16, 2024
9133014
added firehose pb
dhyaniarun1993 Feb 18, 2024
d110d39
revert back to streaming fast pb
dhyaniarun1993 Feb 19, 2024
fb7018e
revert back to streaming fast pb
dhyaniarun1993 Feb 19, 2024
b46f0fd
fire init bugfixes
dhyaniarun1993 Feb 19, 2024
15bf7e1
firehose printer bugfix
dhyaniarun1993 Feb 19, 2024
ac60358
bugfix
dhyaniarun1993 Feb 19, 2024
aa68ce4
ignore BalanceDecreaseSelfdestructBurn
dhyaniarun1993 Feb 20, 2024
22ee5a7
Merge branch 'feature/erigon-live-tracer-port' into feat/firehose-liv…
dhyaniarun1993 Feb 20, 2024
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
4 changes: 3 additions & 1 deletion cmd/state/commands/opcode_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (ot *opcodeTracer) OnBlockStart(b *types.Block, td *big.Int, finalized, saf
func (ot *opcodeTracer) OnBlockEnd(err error) {
}

func (ot *opcodeTracer) OnGenesisBlock(b *types.Block, alloc types.GenesisAlloc) {
func (ot *opcodeTracer) OnGenesisBlock(b *types.Block, alloc types.GenesisAlloc, chainConfig *chain2.Config) {
}

func (ot *opcodeTracer) OnBeaconBlockRootStart(root libcommon.Hash) {}
Expand All @@ -422,6 +422,8 @@ func (ot *opcodeTracer) OnStorageChange(a libcommon.Address, k *libcommon.Hash,

func (ot *opcodeTracer) OnLog(log *types.Log) {}

func (ot *opcodeTracer) OnNewAccount(a libcommon.Address) {}

// GetResult returns an empty json object.
func (ot *opcodeTracer) GetResult() (json.RawMessage, error) {
return json.RawMessage(`{}`), nil
Expand Down
4 changes: 3 additions & 1 deletion cmd/state/exec3/calltracer_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (ct *CallTracer) OnBlockStart(b *types.Block, td *big.Int, finalized, safe
func (ct *CallTracer) OnBlockEnd(err error) {
}

func (ct *CallTracer) OnGenesisBlock(b *types.Block, alloc types.GenesisAlloc) {
func (ct *CallTracer) OnGenesisBlock(b *types.Block, alloc types.GenesisAlloc, chainConfig *chain.Config) {
}

func (ct *CallTracer) OnBeaconBlockRootStart(root libcommon.Hash) {}
Expand All @@ -83,6 +83,8 @@ func (ct *CallTracer) OnStorageChange(a libcommon.Address, k *libcommon.Hash, pr

func (ct *CallTracer) OnLog(log *types.Log) {}

func (ct *CallTracer) OnNewAccount(a libcommon.Address) {}

// GetResult returns an empty json object.
func (ct *CallTracer) GetResult() (json.RawMessage, error) {
return json.RawMessage(`{}`), nil
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type BlockchainLogger interface {
// `td` is the total difficulty prior to `block`.
OnBlockStart(block *types.Block, td *big.Int, finalized *types.Header, safe *types.Header, chainConfig *chain.Config)
OnBlockEnd(err error)
OnGenesisBlock(genesis *types.Block, alloc types.GenesisAlloc)
OnGenesisBlock(genesis *types.Block, alloc types.GenesisAlloc, chainConfig *chain.Config)
}

type RejectedTx struct {
Expand Down
2 changes: 1 addition & 1 deletion core/genesis_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func write(tx kv.RwTx, g *types.Genesis, tmpDir string, logger log.Logger, bcLog
}

if bcLogger != nil {
bcLogger.OnGenesisBlock(block, g.Alloc)
bcLogger.OnGenesisBlock(block, g.Alloc, config)
}

// We support ethash/merge for issuance (for now)
Expand Down
5 changes: 5 additions & 0 deletions core/state/intra_block_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type StateLogger interface {
OnNonceChange(addr libcommon.Address, prev, new uint64)
OnCodeChange(addr libcommon.Address, prevCodeHash libcommon.Hash, prevCode []byte, codeHash libcommon.Hash, code []byte)
OnStorageChange(addr libcommon.Address, slot *libcommon.Hash, prev, new uint256.Int)
OnNewAccount(addr libcommon.Address)
OnLog(log *types.Log)
}

Expand Down Expand Up @@ -564,6 +565,10 @@ func (sdb *IntraBlockState) createObject(addr libcommon.Address, previous *state
sdb.journal.append(resetObjectChange{account: &addr, prev: previous})
}

if sdb.logger != nil {
sdb.logger.OnNewAccount(addr)
}

newobj.newlyCreated = true
sdb.setStateObject(addr, newobj)
return newobj
Expand Down
5 changes: 4 additions & 1 deletion eth/calltracer/calltracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func (ct *CallTracer) OnBlockStart(b *types.Block, td *big.Int, finalized, safe

func (ct *CallTracer) OnBlockEnd(err error) {}

func (ct *CallTracer) OnGenesisBlock(b *types.Block, alloc types.GenesisAlloc) {}
func (ct *CallTracer) OnGenesisBlock(b *types.Block, alloc types.GenesisAlloc, chainConfig *chain.Config) {
}

func (ct *CallTracer) OnBeaconBlockRootStart(root libcommon.Hash) {}

Expand All @@ -90,6 +91,8 @@ func (ct *CallTracer) OnStorageChange(addr libcommon.Address, k *libcommon.Hash,

func (ct *CallTracer) OnLog(log *types.Log) {}

func (ct *CallTracer) OnNewAccount(a libcommon.Address) {}

func (ct *CallTracer) CaptureExit(output []byte, usedGas uint64, err error, reverted bool) {
}

Expand Down
Loading