diff --git a/core/bor_blockchain.go b/core/bor_blockchain.go index 1a5ce39e62..e0525b8365 100644 --- a/core/bor_blockchain.go +++ b/core/bor_blockchain.go @@ -1,6 +1,7 @@ package core import ( + "fmt" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" @@ -8,6 +9,7 @@ import ( // GetBorReceiptByHash retrieves the bor block receipt in a given block. func (bc *BlockChain) GetBorReceiptByHash(hash common.Hash) *types.Receipt { + fmt.Printf(">>>>> GetBorBlockReceiptBorBlockchain\n") if receipt, ok := bc.borReceiptsCache.Get(hash); ok { return receipt } diff --git a/eth/bor_api_backend.go b/eth/bor_api_backend.go index 9f909caa8e..cfa9e74f72 100644 --- a/eth/bor_api_backend.go +++ b/eth/bor_api_backend.go @@ -20,6 +20,7 @@ var errBorEngineNotAvailable error = errors.New("Only available in Bor engine") // GetRootHash returns root hash for given start and end block func (b *EthAPIBackend) GetRootHash(ctx context.Context, starBlockNr uint64, endBlockNr uint64) (string, error) { var api *bor.API + fmt.Printf(">>>>> GetRootHashApiBackend\n") for _, _api := range b.eth.Engine().APIs(b.eth.BlockChain()) { if _api.Namespace == "bor" { @@ -42,6 +43,7 @@ func (b *EthAPIBackend) GetRootHash(ctx context.Context, starBlockNr uint64, end // GetRootHash returns root hash for given start and end block func (b *EthAPIBackend) GetVoteOnHash(ctx context.Context, starBlockNr uint64, endBlockNr uint64, hash string, milestoneId string) (bool, error) { var api *bor.API + fmt.Printf(">>>>> GetVoteOnHashApiBackend\n") for _, _api := range b.eth.Engine().APIs(b.eth.BlockChain()) { if _api.Namespace == "bor" { @@ -90,6 +92,8 @@ func (b *EthAPIBackend) GetVoteOnHash(ctx context.Context, starBlockNr uint64, e // GetBorBlockReceipt returns bor block receipt func (b *EthAPIBackend) GetBorBlockReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error) { + fmt.Printf(">>>>> GetBorBlockReceiptApiBackend\n") + receipt := b.eth.blockchain.GetBorReceiptByHash(hash) if receipt == nil { return nil, ethereum.NotFound @@ -100,6 +104,7 @@ func (b *EthAPIBackend) GetBorBlockReceipt(ctx context.Context, hash common.Hash // GetBorBlockLogs returns bor block logs func (b *EthAPIBackend) GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*types.Log, error) { + fmt.Printf(">>>>> GetBorBlockLogsApiBackend\n") receipt := b.eth.blockchain.GetBorReceiptByHash(hash) if receipt == nil { return nil, nil @@ -110,21 +115,25 @@ func (b *EthAPIBackend) GetBorBlockLogs(ctx context.Context, hash common.Hash) ( // GetBorBlockTransaction returns bor block tx func (b *EthAPIBackend) GetBorBlockTransaction(ctx context.Context, hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) { + fmt.Printf(">>>>> GetBorBlockTransactionApiBackend\n") tx, blockHash, blockNumber, index := rawdb.ReadBorTransaction(b.eth.ChainDb(), hash) return tx, blockHash, blockNumber, index, nil } func (b *EthAPIBackend) GetBorBlockTransactionWithBlockHash(ctx context.Context, txHash common.Hash, blockHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) { + fmt.Printf(">>>>> GetBorBlockTransactionWithBlockHashApiBackend\n") tx, blockHash, blockNumber, index := rawdb.ReadBorTransactionWithBlockHash(b.eth.ChainDb(), txHash, blockHash) return tx, blockHash, blockNumber, index, nil } // SubscribeStateSyncEvent subscribes to state sync event func (b *EthAPIBackend) SubscribeStateSyncEvent(ch chan<- core.StateSyncEvent) event.Subscription { + fmt.Printf(">>>>> SubscribeStateSyncEventApiBackend\n") return b.eth.BlockChain().SubscribeStateSyncEvent(ch) } // SubscribeChain2HeadEvent subscribes to reorg/head/fork event func (b *EthAPIBackend) SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription { + fmt.Printf(">>>>> SubscribeChain2HeadEventApiBackend\n") return b.eth.BlockChain().SubscribeChain2HeadEvent(ch) }