Updates to reflect comments on original merge.
This commit is contained in:
parent
59a823409e
commit
967626b075
@ -4,7 +4,7 @@ package rawdb
|
|||||||
import (
|
import (
|
||||||
"github.com/ethereum/go-ethereum/plugins"
|
"github.com/ethereum/go-ethereum/plugins"
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
// "github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -57,64 +57,64 @@ func PluginCommitUpdate(pl *plugins.PluginLoader, num uint64) {
|
|||||||
fn(i, update)
|
fn(i, update)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ = pl.Lookup("AppendAncient", func(item interface{}) bool {
|
appendAncientFnList := pl.Lookup("AppendAncient", func(item interface{}) bool {
|
||||||
_, ok := item.(func(number uint64, hash, header, body, receipts, td []byte))
|
_, ok := item.(func(number uint64, hash, header, body, receipts, td []byte))
|
||||||
if ok { log.Warn("PlugEth's AppendAncient is deprecated. Please update to ModifyAncients.") }
|
if ok { log.Warn("PluGeth's AppendAncient is deprecated. Please update to ModifyAncients.") }
|
||||||
return ok
|
return ok
|
||||||
})
|
})
|
||||||
// if len(appendAncientFnList) > 0 {
|
if len(appendAncientFnList) > 0 {
|
||||||
// var (
|
var (
|
||||||
// hash []byte
|
hash []byte
|
||||||
// header []byte
|
header []byte
|
||||||
// body []byte
|
body []byte
|
||||||
// receipts []byte
|
receipts []byte
|
||||||
// td []byte
|
td []byte
|
||||||
// )
|
)
|
||||||
// if hashi, ok := update[freezerHashTable]; ok {
|
if hashi, ok := update[chainFreezerHashTable]; ok {
|
||||||
// switch v := hashi.(type) {
|
switch v := hashi.(type) {
|
||||||
// case []byte:
|
case []byte:
|
||||||
// hash = v
|
hash = v
|
||||||
// default:
|
default:
|
||||||
// hash, _ = rlp.EncodeToBytes(v)
|
hash, _ = rlp.EncodeToBytes(v)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if headeri, ok := update[freezerHeaderTable]; ok {
|
if headeri, ok := update[chainFreezerHeaderTable]; ok {
|
||||||
// switch v := headeri.(type) {
|
switch v := headeri.(type) {
|
||||||
// case []byte:
|
case []byte:
|
||||||
// header = v
|
header = v
|
||||||
// default:
|
default:
|
||||||
// header, _ = rlp.EncodeToBytes(v)
|
header, _ = rlp.EncodeToBytes(v)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if bodyi, ok := update[freezerBodiesTable]; ok {
|
if bodyi, ok := update[chainFreezerBodiesTable]; ok {
|
||||||
// switch v := bodyi.(type) {
|
switch v := bodyi.(type) {
|
||||||
// case []byte:
|
case []byte:
|
||||||
// body = v
|
body = v
|
||||||
// default:
|
default:
|
||||||
// body, _ = rlp.EncodeToBytes(v)
|
body, _ = rlp.EncodeToBytes(v)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if receiptsi, ok := update[freezerReceiptTable]; ok {
|
if receiptsi, ok := update[chainFreezerReceiptTable]; ok {
|
||||||
// switch v := receiptsi.(type) {
|
switch v := receiptsi.(type) {
|
||||||
// case []byte:
|
case []byte:
|
||||||
// receipts = v
|
receipts = v
|
||||||
// default:
|
default:
|
||||||
// receipts, _ = rlp.EncodeToBytes(v)
|
receipts, _ = rlp.EncodeToBytes(v)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if tdi, ok := update[freezerDifficultyTable]; ok {
|
if tdi, ok := update[chainFreezerDifficultyTable]; ok {
|
||||||
// switch v := tdi.(type) {
|
switch v := tdi.(type) {
|
||||||
// case []byte:
|
case []byte:
|
||||||
// td = v
|
td = v
|
||||||
// default:
|
default:
|
||||||
// td, _ = rlp.EncodeToBytes(v)
|
td, _ = rlp.EncodeToBytes(v)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// for _, fni := range appendAncientFnList {
|
for _, fni := range appendAncientFnList {
|
||||||
// if fn, ok := fni.(func(number uint64, hash, header, body, receipts, td []byte)); ok {
|
if fn, ok := fni.(func(number uint64, hash, header, body, receipts, td []byte)); ok {
|
||||||
// fn(i, hash, header, body, receipts, td)
|
fn(i, hash, header, body, receipts, td)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
go.mod
2
go.mod
@ -105,5 +105,3 @@ require (
|
|||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace github.com/openrelayxyz/plugeth-utils v0.0.18 => ../plugeth-utils
|
|
||||||
|
@ -173,8 +173,9 @@ func (b *Backend) TxPoolContent() (map[core.Address][][]byte, map[core.Address][
|
|||||||
func (b *Backend) BloomStatus() (uint64, uint64) {
|
func (b *Backend) BloomStatus() (uint64, uint64) {
|
||||||
return b.b.BloomStatus()
|
return b.b.BloomStatus()
|
||||||
}
|
}
|
||||||
func (b *Backend) GetLogs(ctx context.Context, blockHash core.Hash, number uint64) ([][]byte, error) {
|
func (b *Backend) GetLogs(ctx context.Context, blockHash core.Hash) ([][]byte, error) {
|
||||||
logs, err := b.b.GetLogs(ctx, common.Hash(blockHash), number)
|
header, _ := b.b.HeaderByHash(ctx, common.Hash(blockHash))
|
||||||
|
logs, err := b.b.GetLogs(ctx, common.Hash(blockHash), uint64(header.Number.Uint64()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user