Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Change network policy label for the update proposals/votes and hw del…
Browse files Browse the repository at this point in the history
…eg certs

The update proposals and votes, and the heavyweight delegation
certificates are currently labelled as MsgTransaction for the purpose of
the network routing policy.

This means we can currently submit such objects from any node and they
will be forwarded to the core nodes. They are of course validated at
every hop.

For the purpose of the byron/shelley transition it will be simpler if
these objects are only submitted directly to the federated core nodes
and not via the relays.

So this patch changes the polciy so that these objects are not forwarded
by the relays. It does this by changing their label so that the existing
network routing policy treats them differently. So rather than being
labelled as MsgTransaction they are labelled as MsgMPC. The existing
policy for the MPC label is that relays do not forward such messages.
  • Loading branch information
dcoutts authored and erikd committed Jun 13, 2019
1 parent 84fd410 commit af9a1fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/src/Pos/Diffusion/Full/Delegation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pskHeavyRelay
:: Logic IO
-> Relay
pskHeavyRelay logic = Data $ DataParams
MsgTransaction
MsgMPC
(\_ _ -> postPskHeavy logic)
-- The message size limit for ProxySKHeavy: a ProxySecretKey with an
-- EpochIndex.
Expand All @@ -60,4 +60,4 @@ sendPskHeavy
-> EnqueueMsg
-> ProxySKHeavy
-> IO ()
sendPskHeavy logTrace enqueue = dataFlow logTrace "pskHeavy" enqueue (MsgTransaction OQ.OriginSender)
sendPskHeavy logTrace enqueue = dataFlow logTrace "pskHeavy" enqueue (MsgMPC OQ.OriginSender)
4 changes: 2 additions & 2 deletions lib/src/Pos/Diffusion/Full/Update.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ proposalRelay logic =
InvReqData
NoMempool $
InvReqDataParams
{ invReqMsgType = MsgTransaction
{ invReqMsgType = MsgMPC
, contentsToKey = KV.toKey kv
, handleInv = \_ -> KV.handleInv kv
, handleReq = \_ -> KV.handleReq kv
Expand All @@ -104,7 +104,7 @@ voteRelay logic =
InvReqData
NoMempool $
InvReqDataParams
{ invReqMsgType = MsgTransaction
{ invReqMsgType = MsgMPC
, contentsToKey = KV.toKey kv
, handleInv = \_ -> KV.handleInv kv
, handleReq = \_ -> KV.handleReq kv
Expand Down

0 comments on commit af9a1fb

Please sign in to comment.