light client core#1989
Conversation
Updated: Tue Nov 24 04:01:28 UTC 2015 |
Current coverage is
|
dcc1375 to
abd5927
Compare
abd5927 to
4ab4452
Compare
There was a problem hiding this comment.
It is, retrieving individual receipts by tx hash doesn't work yet, only retrieving all receipts from a block by block hash. We have to add some new messages to the LES/1 protocol to cover relaying transactions and checking their status but it's still being figured out.
There was a problem hiding this comment.
var list []*Peer
for _, p := range ps.peers {
list = append(list, p)
}or
list := make([]*Peer, len(ps.peers))
var i int
for _, p := range ps.peers {
list[i]=p
i++
}There was a problem hiding this comment.
This is actually fine since append does not grow the array. Just the slice and there's no additional overhead of realloc every time append is called.
|
One general comment. I wouldn't rename the |
There was a problem hiding this comment.
I don't really see the value in this method. It just wraps the one below, gives it a weird name and provides confusion as to why the same thing can be done multiple ways. NewChainAccess(db, false) would be ihmo just fine to call from client code.
|
The PR very heavily leaked networking/protocol primitives into the database access layer. IMHO, no notion of peers, peer sets, packets, protocols, etc should be allowed in The access layer in core should be simply an adapter to either a database, or a light ethereum object. It must not have a clue about how the data is retrieved by the underlying implementations. My suggestion would be to define maybe two interfaces: a |
There was a problem hiding this comment.
Don't create a new access layer every time you want to generate a chain. Pass it as a parameter instead of the db ethdb.Database. Maybe @fjl has an input on this? But IMHO if we replace the databases with accessor objects, then they should be fully replaced from their point of creation and not just wrapped at the last minute (would be very very wasteful memory wise to have a lot of small wraps deep in the code).
|
Please |
There was a problem hiding this comment.
it is thread safe to write the results because Deliver that calls this lock chainAccess including all requests sent. Please comment that caller must hold the lock over req to be used concurrently.
the same for Valid functions of all request types
No description provided.