From 294066e6329945a802255dbbe429adb371ecad55 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Fri, 27 Jan 2023 10:03:01 -0800 Subject: [PATCH] Aleterations and additions to plugeth injection comments. --- core/blockchain.go | 3 ++- core/rawdb/freezer_batch.go | 4 ++++ eth/tracers/api.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 5c1e08592..1880d8401 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1367,7 +1367,8 @@ func (bc *BlockChain) writeBlockAndSetHead(block *types.Block, receipts []*types bc.writeHeadBlock(block) } bc.futureBlocks.Remove(block.Hash()) - + + // ptd and externTd are both PluGeth injections ptd := bc.GetTd(block.ParentHash(), block.NumberU64()-1) if ptd == nil { return NonStatTy, consensus.ErrUnknownAncestor diff --git a/core/rawdb/freezer_batch.go b/core/rawdb/freezer_batch.go index df9ffa30f..99d226e9a 100644 --- a/core/rawdb/freezer_batch.go +++ b/core/rawdb/freezer_batch.go @@ -44,13 +44,17 @@ func newFreezerBatch(f *Freezer) *freezerBatch { // Append adds an RLP-encoded item of the given kind. func (batch *freezerBatch) Append(kind string, num uint64, item interface{}) error { + // begin PluGeth injection PluginTrackUpdate(num, kind, item) + // end PluGeth injection return batch.tables[kind].Append(num, item) } // AppendRaw adds an item of the given kind. func (batch *freezerBatch) AppendRaw(kind string, num uint64, item []byte) error { + // being PluGeth injection PluginTrackUpdate(num, kind, item) + // end PluGeth injection return batch.tables[kind].AppendRaw(num, item) } diff --git a/eth/tracers/api.go b/eth/tracers/api.go index df55a298d..0fd1983b7 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -886,7 +886,6 @@ func (api *API) traceTx(ctx context.Context, message core.Message, txctx *Contex // Get the tracer from the plugin loader //begin PluGeth code injection if tr, ok := getPluginTracer(*config.Tracer); ok { - //end PluGeth code injection tracer = tr(statedb, vmctx) } else { tracer, err = New(*config.Tracer, txctx, config.TracerConfig) @@ -894,6 +893,7 @@ func (api *API) traceTx(ctx context.Context, message core.Message, txctx *Contex return nil, err } } + // end PluGeth injection } // Define a meaningful timeout of a single transaction trace if config.Timeout != nil {