Skip to content

Conversation

@cali-jumptrading
Copy link
Contributor

No description provided.

@cali-jumptrading cali-jumptrading force-pushed the cali/add-https branch 4 times, most recently from af17034 to 29a54f9 Compare September 12, 2025 22:30
@cali-jumptrading cali-jumptrading force-pushed the cali/add-https branch 24 times, most recently from a0bd347 to 3488f1f Compare September 23, 2025 16:31
@cali-jumptrading cali-jumptrading marked this pull request as ready for review September 23, 2025 16:33
@cali-jumptrading cali-jumptrading changed the title snapshots: add https [WIP] snapshots: add https Sep 23, 2025
http_connect_ssl( fd_sshttp_t * http,
long now ) {
if( FD_UNLIKELY( now>http->deadline ) ) {
FD_LOG_WARNING(("deadline exceeded during connect"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FD_LOG_WARNING(("deadline exceeded during connect"));
FD_LOG_WARNING(( "deadline while connecting to HTTPS snapshot server" ));

Might also want to log the peer URL here

if( FD_UNLIKELY( ssl_err!=1 ) ) {
int ssl_err_code = SSL_get_error( http->ssl, ssl_err );
if( FD_UNLIKELY( ssl_err_code!=SSL_ERROR_WANT_READ && ssl_err_code!=SSL_ERROR_WANT_WRITE ) ) {
FD_LOG_WARNING(( "SSL_connect failed (%d)", ssl_err ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These WARNING logs should ideally be operator friendly.

e.g. error while downloading snapshot from https://: SSL_connect failed (%i-%s)

if( FD_LIKELY( res<=0 ) ) {
int ssl_err_code = SSL_get_error( http->ssl, res );
if( FD_UNLIKELY( ssl_err_code!=SSL_ERROR_WANT_READ && ssl_err_code!=SSL_ERROR_WANT_WRITE && res!=0 ) ) {
FD_LOG_WARNING(( "SSL_shutdown failed (%d)", ssl_err_code ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, warning log shoudl be operator friendly

int ssl_err = SSL_get_error( http->ssl, read_res );

if( FD_UNLIKELY( ssl_err!=SSL_ERROR_WANT_READ && ssl_err!=SSL_ERROR_WANT_WRITE ) ) {
FD_LOG_WARNING(( "SSL_read failed (%d)", ssl_err ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator friendly warning log

int ssl_err = SSL_get_error( http->ssl, write_res );

if( FD_UNLIKELY( ssl_err!=SSL_ERROR_WANT_READ && ssl_err!=SSL_ERROR_WANT_WRITE ) ) {
FD_LOG_WARNING(( "SSL_write failed (%d)", ssl_err ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator friendly warning log

long sent = sendto( http->sockfd, buf, bufsz, 0, NULL, 0 );
if( FD_UNLIKELY( -1==sent && errno==EAGAIN ) ) return FD_SSHTTP_ADVANCE_AGAIN;
else if( FD_UNLIKELY( -1==sent ) ) {
FD_LOG_WARNING(( "sendto() failed (%d-%s)", errno, fd_io_strerror( errno ) ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator friendly warning log

.fd = http->sockfd,
.events = POLLIN,
};
fd_syscall_poll( &pfd, 1 /*fds*/, 1 /*ms*/ );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check error code of syscall (FD_LOG_ERR if poll returns a weird errno)

int ssl_err = SSL_get_error( ssresolve->ssl, write_res );

if( FD_UNLIKELY( ssl_err!=SSL_ERROR_WANT_READ && ssl_err!=SSL_ERROR_WANT_WRITE ) ) {
FD_LOG_WARNING(( "SSL_write failed (%d)", ssl_err ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator friendly error log


read = (long)read_res;
#else
FD_LOG_ERR(( "cannot use HTTPS without OpenSSL" ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this build of Firedancer does not support OpenSSL, rebuild with deps.sh

or something along those lines, otherwise operator is going to be confused why OpenSSL was not fonud

if( FD_UNLIKELY( ssl_err!=1 ) ) {
int ssl_err_code = SSL_get_error( ssresolve->ssl, ssl_err );
if( FD_UNLIKELY( ssl_err_code!=SSL_ERROR_WANT_READ && ssl_err_code!=SSL_ERROR_WANT_WRITE ) ) {
FD_LOG_WARNING(( "SSL_connect failed (%d)", ssl_err_code ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator friendly error log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll address log-related comments in a follow up

@ripatel-fd ripatel-fd self-requested a review November 21, 2025 17:20
@ripatel-fd ripatel-fd dismissed their stale review November 21, 2025 17:20

changed my mind

ripatel-fd
ripatel-fd previously approved these changes Nov 21, 2025
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.05664 s 0.050926 s -10.088%
backtest mainnet-368528500-perf snapshot load 2.789 s 2.222 s -20.330%
backtest mainnet-368528500-perf total elapsed 56.639559 s 50.926228 s -10.087%
firedancer mem usage with mainnet.toml 1001.1 GiB 1001.23 GiB 0.013%

ripatel-fd
ripatel-fd previously approved these changes Nov 24, 2025
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.073687 s 0.07409 s 0.547%
backtest mainnet-368528500-perf snapshot load 4.206 s 4 s -4.898%
backtest mainnet-368528500-perf total elapsed 73.686691 s 74.090247 s 0.548%
firedancer mem usage with mainnet.toml 1001.1 GiB 1001.23 GiB 0.013%

Fixes incorrect usage of the OpenSSL 'static' feature which is
intended for statically linking glibc.  The static feature breaks
multi-threaded use of OpenSSL, so it should be disabled.

Note that libssl.a still gets built, so OpenSSL itself is still
statically linked.
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.057834 s 0.050941 s -11.919%
backtest mainnet-368528500-perf snapshot load 2.739 s 1.668 s -39.102%
backtest mainnet-368528500-perf total elapsed 57.833887 s 50.940716 s -11.919%
firedancer mem usage with mainnet.toml 1001.1 GiB 1001.23 GiB 0.013%

@cali-jumptrading cali-jumptrading merged commit 4a5957a into main Nov 24, 2025
22 of 37 checks passed
@cali-jumptrading cali-jumptrading deleted the cali/add-https branch November 24, 2025 22:39
FD_MCNT_SET( TOWER, HARD_FORKS_PRUNED, ctx->metrics.hard_forks.pruned );

FD_MGAUGE_SET( TOWER, HARD_FORKS_ACTIVE, ctx->metrics.hard_forks.active );
FD_MGAUGE_SET( TOWER, HARD_FORKS_MAX_WIDTH, ctx->metrics.hard_forks.max_width );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, charlie forgot to remove this line after he removed the metric in metrics.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants