mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
beacon/light/api: log server requests
This commit is contained in:
parent
9c39132fec
commit
96df24d81e
1 changed files with 4 additions and 0 deletions
|
|
@ -60,18 +60,22 @@ func (s *ApiServer) SendRequest(id request.ID, req request.Request) {
|
||||||
var resp request.Response
|
var resp request.Response
|
||||||
switch data := req.(type) {
|
switch data := req.(type) {
|
||||||
case sync.ReqUpdates:
|
case sync.ReqUpdates:
|
||||||
|
log.Debug("Requesting light client update", "period", data.FirstPeriod, "count", data.Count)
|
||||||
if updates, committees, err := s.api.GetBestUpdatesAndCommittees(data.FirstPeriod, data.Count); err == nil {
|
if updates, committees, err := s.api.GetBestUpdatesAndCommittees(data.FirstPeriod, data.Count); err == nil {
|
||||||
resp = sync.RespUpdates{Updates: updates, Committees: committees}
|
resp = sync.RespUpdates{Updates: updates, Committees: committees}
|
||||||
}
|
}
|
||||||
case sync.ReqHeader:
|
case sync.ReqHeader:
|
||||||
|
log.Debug("Requesting beacon header", "hash", common.Hash(data))
|
||||||
if header, err := s.api.GetHeader(common.Hash(data)); err == nil {
|
if header, err := s.api.GetHeader(common.Hash(data)); err == nil {
|
||||||
resp = header
|
resp = header
|
||||||
}
|
}
|
||||||
case sync.ReqCheckpointData:
|
case sync.ReqCheckpointData:
|
||||||
|
log.Debug("Requesting beacon checkpoint data", "hash", common.Hash(data))
|
||||||
if bootstrap, err := s.api.GetCheckpointData(common.Hash(data)); err == nil {
|
if bootstrap, err := s.api.GetCheckpointData(common.Hash(data)); err == nil {
|
||||||
resp = bootstrap
|
resp = bootstrap
|
||||||
}
|
}
|
||||||
case sync.ReqBeaconBlock:
|
case sync.ReqBeaconBlock:
|
||||||
|
log.Debug("Requesting beacon block", "hash", common.Hash(data))
|
||||||
if block, err := s.api.GetBeaconBlock(common.Hash(data)); err == nil {
|
if block, err := s.api.GetBeaconBlock(common.Hash(data)); err == nil {
|
||||||
resp = block
|
resp = block
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue