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
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ add_library(lantern STATIC
src/core/client_sync.c
src/core/client_sync_blocks.c
src/core/client_sync_votes.c
src/core/client_utils.c
src/core/client_validator.c
src/genesis/genesis.c
src/encoding/snappy.c
src/networking/enr.c
src/core/client_utils.c
src/core/client_validator.c
src/genesis/genesis.c
src/genesis/genesis_parse.c
src/genesis/genesis_parse_registry.c
src/genesis/genesis_validator_config.c
src/encoding/snappy.c
src/networking/enr.c
src/networking/gossip.c
src/networking/gossipsub_service.c
src/networking/gossip_payloads.c
Expand Down
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,19 @@ FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# Install runtime dependencies
# Set to "true" to include gdb and perf for debugging/profiling
ARG INCLUDE_DEBUG_TOOLS=false

# Install runtime dependencies (and optionally profiling tools)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
gdb \
libssl3 \
libstdc++6 \
zlib1g \
&& if [ "$INCLUDE_DEBUG_TOOLS" = "true" ]; then \
apt-get install -y --no-install-recommends gdb linux-tools-generic \
&& ln -sf /usr/lib/linux-tools/*/perf /usr/local/bin/perf || true; \
fi \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /opt/lantern /opt/lantern
Expand Down
2 changes: 1 addition & 1 deletion external/c-libp2p
21 changes: 21 additions & 0 deletions include/lantern/networking/reqresp_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@
#define LANTERN_REQRESP_RESPONSE_INVALID_REQUEST 2u
#define LANTERN_REQRESP_RESPONSE_SERVER_ERROR 3u

/**
* Reqresp service error codes.
*
* Functions return 0 on success and a negative value on failure.
*
* When a function also provides an `out_err` parameter, `out_err` contains the
* underlying libp2p error code or `-errno` value for debugging.
*/
typedef enum
{
LANTERN_REQRESP_OK = 0,
LANTERN_REQRESP_ERR_INVALID_PARAM = -1000,
LANTERN_REQRESP_ERR_SET_DEADLINE = -1001,
LANTERN_REQRESP_ERR_SET_READ_INTEREST = -1002,
LANTERN_REQRESP_ERR_STREAM_READ = -1003,
LANTERN_REQRESP_ERR_STREAM_WRITE = -1004,
LANTERN_REQRESP_ERR_VARINT_HEADER_TOO_LONG = -1005,
LANTERN_REQRESP_ERR_PAYLOAD_TOO_LARGE = -1006,
LANTERN_REQRESP_ERR_ALLOC = -1007,
} lantern_reqresp_error;

enum lantern_reqresp_protocol_kind {
LANTERN_REQRESP_PROTOCOL_STATUS = 0,
LANTERN_REQRESP_PROTOCOL_BLOCKS_BY_ROOT = 1,
Expand Down
8 changes: 4 additions & 4 deletions src/core/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ static lantern_client_error client_setup_validators(
return LANTERN_CLIENT_ERR_CONFIG;
}

if (configure_hash_sig_sources(client, options) != 0)
if (lantern_client_configure_hash_sig_sources(client, options) != 0)
{
lantern_log_error(
"client",
Expand Down Expand Up @@ -1241,7 +1241,7 @@ static lantern_client_error client_setup_validators(
return LANTERN_CLIENT_ERR_VALIDATOR;
}

if (load_hash_sig_keys(client) != 0)
if (lantern_client_load_hash_sig_keys(client) != 0)
{
return LANTERN_CLIENT_ERR_VALIDATOR;
}
Expand Down Expand Up @@ -1529,7 +1529,7 @@ static void shutdown_validator_and_keys(struct lantern_client *client)
stop_validator_service(client);
stop_ping_service(client);
stop_peer_dialer(client);
free_hash_sig_pubkeys(client);
lantern_client_free_hash_sig_pubkeys(client);
free(client->hash_sig_key_dir);
client->hash_sig_key_dir = NULL;
free(client->hash_sig_public_template);
Expand Down Expand Up @@ -1842,7 +1842,7 @@ static void shutdown_state_and_runtime(struct lantern_client *client)
}
lantern_fork_choice_reset(&client->fork_choice);
client->has_fork_choice = false;
reset_local_validators(client);
lantern_client_reset_local_validators(client);
lantern_validator_assignment_reset(&client->validator_assignment);
client->has_validator_assignment = false;
lantern_consensus_runtime_reset(&client->runtime);
Expand Down
Loading