From 3611dea48ca933c16cd66b565d953801555e6c0e Mon Sep 17 00:00:00 2001 From: mubariz Date: Tue, 3 Feb 2026 15:34:03 +0500 Subject: [PATCH 1/2] update_sysvar_epoch_schedule_write --- .../runtime/sysvar/fd_sysvar_epoch_schedule.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c b/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c index 5b7336650aa..541f7d639e3 100644 --- a/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c +++ b/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c @@ -37,19 +37,18 @@ fd_sysvar_epoch_schedule_write( fd_bank_t * bank, fd_funk_txn_xid_t const * xid, fd_capture_ctx_t * capture_ctx, fd_epoch_schedule_t const * epoch_schedule ) { - ulong sz = fd_epoch_schedule_size( epoch_schedule ); - /* TODO remove alloca */ - uchar enc[ sz ]; - memset( enc, 0, sz ); + + uchar enc[ FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ ] = {0}; + fd_bincode_encode_ctx_t ctx = { .data = enc, - .dataend = enc + sz + .dataend = enc + FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ }; - if( fd_epoch_schedule_encode( epoch_schedule, &ctx ) ) { + if( FD_UNLIKELY( fd_epoch_schedule_encode( epoch_schedule, &ctx ) ) ) { FD_LOG_ERR(("fd_epoch_schedule_encode failed")); } - fd_sysvar_account_update( bank, accdb, xid, capture_ctx, &fd_sysvar_epoch_schedule_id, enc, sz ); + fd_sysvar_account_update( bank, accdb, xid, capture_ctx, &fd_sysvar_epoch_schedule_id, enc, FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ ); } fd_epoch_schedule_t * From 2efd2c052d0b95630b85c87a086997a3e8c12dde Mon Sep 17 00:00:00 2001 From: mubariz Date: Tue, 3 Feb 2026 20:15:06 +0500 Subject: [PATCH 2/2] remove ts --- src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c b/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c index 541f7d639e3..446897aeb54 100644 --- a/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c +++ b/src/flamenco/runtime/sysvar/fd_sysvar_epoch_schedule.c @@ -37,15 +37,15 @@ fd_sysvar_epoch_schedule_write( fd_bank_t * bank, fd_funk_txn_xid_t const * xid, fd_capture_ctx_t * capture_ctx, fd_epoch_schedule_t const * epoch_schedule ) { - + uchar enc[ FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ ] = {0}; - + fd_bincode_encode_ctx_t ctx = { .data = enc, .dataend = enc + FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ }; if( FD_UNLIKELY( fd_epoch_schedule_encode( epoch_schedule, &ctx ) ) ) { - FD_LOG_ERR(("fd_epoch_schedule_encode failed")); + FD_LOG_ERR(( "fd_epoch_schedule_encode failed" )); } fd_sysvar_account_update( bank, accdb, xid, capture_ctx, &fd_sysvar_epoch_schedule_id, enc, FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ );