Merge pull request #66 from openrelayxyz/bugfix/add-missing-injection-notation

Aleterations and additions to plugeth injection comments.
This commit is contained in:
AusIV 2023-01-27 17:24:42 -06:00 committed by GitHub
commit 94d0740fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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)
}

View File

@ -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 {