Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .daily_canary
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A daily, just for good measure.
Just want to be making daily records
6 changes: 5 additions & 1 deletion src/node/node_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ namespace ccf
// BFT consensus requires a stable order of node IDs so that the
// primary node in a given view can be computed deterministically by
// all nodes in the network
self = "0";
// See https://github.com/microsoft/CCF/issues/1852

// Pad node id string to avoid memory alignment issues on
// node-to-node messages
self = fmt::format("{:#08}", 0);
}

setup_snapshotter();
Expand Down
6 changes: 4 additions & 2 deletions src/node/rpc/node_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ namespace ccf
}
else
{
joining_node_id = std::to_string(
get_next_id(tx.rw(this->network.values), NEXT_NODE_ID));
// Pad node id string to avoid memory alignment issues on
// node-to-node messages
joining_node_id = fmt::format(
"{:#08}", get_next_id(tx.rw(this->network.values), NEXT_NODE_ID));
}

#ifdef GET_QUOTE
Expand Down
2 changes: 1 addition & 1 deletion tests/infra/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _start(
else:
# BFT consensus should deterministically compute the primary id from the
# consensus view, so node ids are monotonic in this case
self.node_id = str(self.local_node_id)
self.node_id = "{:0>8}".format(self.local_node_id)

self._read_ports()
LOG.info(f"Node {self.local_node_id} started: {self.node_id}")
Expand Down