Go to file
rippleitinnz a770ff3a03 feat: dynamic user idle_timeout from patch.cfg without container restart
When user.idle_timeout is present in patch.cfg, apply_patch_config() now
updates all active user sessions via usr::update_idle_timeout() and also
updates the cached metric_thresholds array for future connections.

Previously user.idle_timeout was only read at startup (usr::init()) and could
not be changed on a running node without a container restart.

Implementation:
- comm_server.hpp: added for_each_session() template to iterate live sessions
  (shared with feat/dynamic-mesh-idle-timeout-from-patch-cfg)
- usr.cpp: added update_idle_timeout() which updates metric_thresholds[4] and
  calls set_threshold(IDLE_CONNECTION_TIMEOUT) on all active user sessions
- conf.cpp: reads user.idle_timeout from patch.cfg in apply_patch_config(),
  calls usr::update_idle_timeout() when value changes

Sibling PRs (part of dynamic config series):
- fix/dynamic-log-level-from-patch-cfg (already raised)
- feat/dynamic-mesh-idle-timeout-from-patch-cfg (already raised)
2026-05-21 09:39:16 +12:00
2021-12-24 13:35:12 +05:30

HotPocket Consensus Engine

What's here?

In development

A C++ version of hotpocket designed for production envrionments, original prototype here: https://github.com/codetsunami/hotpocket

Libraries

Setting up HotPocket development environment

Run the setup script located at the repo root (tested on Ubuntu 20.04).

./dev-setup.sh

Build HotPocket

  1. Run cmake . (You only have to do this once)
  2. Run make (HotPocket binary will be created as ./build/hpcore)
  3. Refer to the Wiki for instructions on running HotPocket.

FlatBuffers message definitions

If you update flatbuffers message definitions, you need to run the flatbuffers code generator to update the stubs.

Example: When you make a change to p2pmsg.fbs defnition file, you need to run this:

flatc -o src/msg/fbuf/ --gen-mutable --cpp src/msg/fbuf/p2pmsg.fbs

Code structure

Code is divided into subsystems via namespaces.

conf:: Handles configuration. Loads and holds the central configuration object. Used by most of the subsystems.

crypto:: Handles cryptographic activities. Wraps libsodium and offers convenience functions.

sc:: Handles smart contract process execution and managing user/SC I/O and npl I/O. Makes use of usr, p2p and hpfs.

usr:: Handles user connections. Makes use of crypto and comm.

p2p:: Handles peer-to-peer connections and message exchange between nodes. Makes use of crypto and comm.

consensus:: Handles consensus and proposal rounds. Makes use of usr, p2p and sc

ledger:: Maintains the ledger and handles ledger syncing activites.

comm:: Handles generic web sockets communication functionality. Mainly acts as a wrapper for hpws.

util:: Contains shared data structures/helper functions used by multiple subsystems.

hpfs:: hpfs state management client helpers.

Description
Consensus Engine for Codius, Linux and Mac Hosts
Readme 20 MiB
Languages
C++ 92.9%
Shell 4.5%
JavaScript 2%
CMake 0.4%
C 0.1%