From 30f057aaf9891fb37f82d94c24b8aa35d388e07b Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Mon, 12 Oct 2015 17:54:59 +0200 Subject: eth/filters: added benchmark --- core/chain_makers.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/chain_makers.go') diff --git a/core/chain_makers.go b/core/chain_makers.go index ba09b3029..c2871a097 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -105,6 +105,10 @@ func (b *BlockGen) AddTx(tx *types.Transaction) { b.receipts = append(b.receipts, receipt) } +func (b *BlockGen) AddReceipt(receipt *types.Receipt) { + b.receipts = append(b.receipts, receipt) +} + // TxNonce returns the next valid transaction nonce for the // account at addr. It panics if the account does not exist. func (b *BlockGen) TxNonce(addr common.Address) uint64 { -- cgit From 6dc14788a238f3e0ec786c6c04d476a3b957e645 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Mon, 12 Oct 2015 17:58:51 +0200 Subject: core, eth/filters, miner, xeth: Optimised log filtering Log filtering is now using a MIPmap like approach where addresses of logs are added to a mapped bloom bin. The current levels for the MIP are in ranges of 1.000.000, 500.000, 100.000, 50.000, 1.000. Logs are therefor filtered in batches of 1.000. --- core/chain_makers.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/chain_makers.go') diff --git a/core/chain_makers.go b/core/chain_makers.go index c2871a097..5f2cfeb63 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -105,7 +105,12 @@ func (b *BlockGen) AddTx(tx *types.Transaction) { b.receipts = append(b.receipts, receipt) } -func (b *BlockGen) AddReceipt(receipt *types.Receipt) { +// AddUncheckedReceipts forcefully adds a receipts to the block without a +// backing transaction. +// +// AddUncheckedReceipts will cause consensus failures when used during real +// chain processing. This is best used in conjuction with raw block insertion. +func (b *BlockGen) AddUncheckedReceipt(receipt *types.Receipt) { b.receipts = append(b.receipts, receipt) } -- cgit