Conversation
Contains commits from #6148, probably needs a rebase |
3ee5390
to
be7dd85
Compare
ethcore/light/src/on_demand/mod.rs
Outdated
caps.serve_headers == c.serve_headers && | ||
caps.serve_chain_since >= c.serve_chain_since && | ||
caps.serve_state_since >= c.serve_chain_since | ||
caps.serve_headers >= c.serve_headers && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serve_headers
is a bool as far as I can see. Why >=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the purpose of this function is to check whether the capabilities c
are encompassed by the capabilities caps
. If c.serve_headers
is false
, caps.serve_headers
can be false
or true
. If c.serve_headers
is true
, caps.serve_headers
can only be true
.
ethcore/light/src/on_demand/mod.rs
Outdated
caps.serve_state_since >= c.serve_chain_since | ||
caps.serve_headers >= c.serve_headers && | ||
(c.serve_chain_since.is_none() || caps.serve_chain_since <= c.serve_chain_since) && | ||
(c.serve_state_since.is_none() || caps.serve_state_since <= c.serve_state_since) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does is_none
allow a request?
Shouldn't chain and state numbers be strictly lower?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the request doesn't require any state or chain serving, then it doesn't matter what the peer capabilities are. If the request does require chain or state serving, then the block number this peer supports beyond should be <=
the request required block number. but this should also guard against caps.serve_since.is_none()
. I will rewrite for clarity
be7dd85
to
6d6351a
Compare
* no seal checking * import command and --no-seal-check for light client * fix eth_call * tweak registry dapps lookup * ignore failed requests to non-server peers
* Light client improvements (#6156) * no seal checking * import command and --no-seal-check for light client * fix eth_call * tweak registry dapps lookup * ignore failed requests to non-server peers * Fix connecting to wildcard addresses. (#6167) * Don't display an overlay in case the time sync check fails. (#6164) * Small improvements to time estimation. * Temporarily disable NTP time check by default.
on_demand
andparity_rpc