Shell/mempool: add identifiers to Worker.Name instances

This commit is contained in:
Raphaël Proust 2018-11-14 13:27:22 +08:00 committed by MBourgoin
parent 6a14afc1b0
commit 8ba2bc2001
No known key found for this signature in database
GPG Key ID: 4B3F7008ABB5B2D0
2 changed files with 16 additions and 12 deletions

View File

@ -226,7 +226,12 @@ module Make (Mempool_worker: Mempool_worker.T)
module Name = struct
type t = P2p_peer.Id.t
let encoding = P2p_peer.Id.encoding
let base = [ "node.mempool.peer_worker" ]
let base =
let proto_hash =
let _: string = Format.flush_str_formatter () in
Format.fprintf Format.str_formatter "%a" Protocol_hash.pp Proto.hash;
Format.flush_str_formatter () in
[ "node"; "mempool"; "peer_worker"; proto_hash ]
let pp = P2p_peer.Id.pp
end

View File

@ -142,16 +142,15 @@ module Make(Static: STATIC)(Proto: Registered_protocol.T)
end)
module Name = struct
type t = Chain_id.t * Protocol_hash.t
let encoding =
Data_encoding.tup2
Chain_id.encoding
Protocol_hash.encoding
let base = [ "validator.mempool" ]
let pp fmt (chain_id, proto_hash) =
Chain_id.pp_short fmt chain_id;
Format.pp_print_string fmt ".";
Protocol_hash.pp_short fmt proto_hash
type t = Chain_id.t
let encoding = Chain_id.encoding
let base =
let proto_hash =
let _: string = Format.flush_str_formatter () in
Format.fprintf Format.str_formatter "%a" Protocol_hash.pp Proto.hash;
Format.flush_str_formatter () in
[ "node"; "mempool"; "worker"; proto_hash ]
let pp = Chain_id.pp_short
end
module Request = struct
@ -563,7 +562,7 @@ module Make(Static: STATIC)(Proto: Registered_protocol.T)
(Worker.launch
table
limits.worker_limits
(chain_id, Proto.hash)
chain_id
{ limits ; chain_db ; validation_state }
(module Handlers) >>= return)