Skip to content

Commit 2ffb66e

Browse files
committed
Merge remote-tracking branch 'origin/main' into asiegel/rpc-resurrect
2 parents 92e67e0 + 239e46d commit 2ffb66e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1226
-537
lines changed

book/api/metrics-generated.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@
113113
| <span class="metrics-name">quic_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">abort</span>"} | gauge | The number of QUIC connections in each state. (connection terminating due to error) |
114114
| <span class="metrics-name">quic_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">close_&#8203;pending</span>"} | gauge | The number of QUIC connections in each state. (connection is closing) |
115115
| <span class="metrics-name">quic_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">dead</span>"} | gauge | The number of QUIC connections in each state. (connection about to be freed) |
116+
| <span class="metrics-name">quic_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">timeout</span>"} | gauge | The number of QUIC connections in each state. (connection timed out) |
116117
| <span class="metrics-name">quic_&#8203;connections_&#8203;created</span> | counter | The total number of connections that have been created. |
117118
| <span class="metrics-name">quic_&#8203;connections_&#8203;closed</span> | counter | Number of connections gracefully closed. |
118119
| <span class="metrics-name">quic_&#8203;connections_&#8203;aborted</span> | counter | Number of connections aborted. |
119120
| <span class="metrics-name">quic_&#8203;connections_&#8203;timed_&#8203;out</span> | counter | Number of connections timed out. |
121+
| <span class="metrics-name">quic_&#8203;connections_&#8203;timeout_&#8203;revived</span> | counter | Number of connections revived after timing out. |
122+
| <span class="metrics-name">quic_&#8203;connections_&#8203;timeout_&#8203;freed</span> | counter | Number of connections freed after timing out. |
120123
| <span class="metrics-name">quic_&#8203;connections_&#8203;retried</span> | counter | Number of connections established with retry. |
121124
| <span class="metrics-name">quic_&#8203;connection_&#8203;error_&#8203;no_&#8203;slots</span> | counter | Number of connections that failed to create due to lack of slots. |
122125
| <span class="metrics-name">quic_&#8203;connection_&#8203;error_&#8203;retry_&#8203;fail</span> | counter | Number of connections that failed during retry (e.g. invalid token). |
@@ -782,10 +785,13 @@
782785
| <span class="metrics-name">send_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">abort</span>"} | gauge | Number of QUIC connections in each state (connection terminating due to error) |
783786
| <span class="metrics-name">send_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">close_&#8203;pending</span>"} | gauge | Number of QUIC connections in each state (connection is closing) |
784787
| <span class="metrics-name">send_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">dead</span>"} | gauge | Number of QUIC connections in each state (connection about to be freed) |
788+
| <span class="metrics-name">send_&#8203;connections_&#8203;state</span><br/>{quic_&#8203;conn_&#8203;state="<span class="metrics-enum">timeout</span>"} | gauge | Number of QUIC connections in each state (connection timed out) |
785789
| <span class="metrics-name">send_&#8203;connections_&#8203;created</span> | counter | Total count of QUIC connections created |
786790
| <span class="metrics-name">send_&#8203;connections_&#8203;closed</span> | counter | Total count of QUIC connections closed |
787791
| <span class="metrics-name">send_&#8203;connections_&#8203;aborted</span> | counter | Total count of QUIC connections aborted |
788792
| <span class="metrics-name">send_&#8203;connections_&#8203;timed_&#8203;out</span> | counter | Total count of QUIC connections timed out |
793+
| <span class="metrics-name">send_&#8203;connections_&#8203;timeout_&#8203;revived</span> | counter | Total count of QUIC connections revived after timing out |
794+
| <span class="metrics-name">send_&#8203;connections_&#8203;timeout_&#8203;freed</span> | counter | Total count of QUIC connections freed after timing out |
789795
| <span class="metrics-name">send_&#8203;connections_&#8203;retried</span> | counter | Total count of QUIC connections retried |
790796
| <span class="metrics-name">send_&#8203;connection_&#8203;error_&#8203;no_&#8203;slots</span> | counter | Total count of connection errors due to no slots |
791797
| <span class="metrics-name">send_&#8203;connection_&#8203;error_&#8203;retry_&#8203;fail</span> | counter | Total count of connection retry failures |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* @name Implicit Void Ptr to Typed Ptr promotion
3+
* @description Implicit conversion from void* to a typed pointer
4+
* @kind problem
5+
* @problem.severity recommendation
6+
* @precision high
7+
* @id firedancer-io/implicit-void-promotion
8+
*/
9+
10+
import cpp
11+
12+
class VoidPointer extends PointerType {
13+
VoidPointer() { this.getBaseType().getUnspecifiedType() instanceof VoidType }
14+
}
15+
16+
predicate implicitVoidPromotion(Type lvalue, Type rvalue) {
17+
not lvalue.getUnderlyingType() instanceof VoidPointer and
18+
rvalue.getUnderlyingType() instanceof VoidPointer
19+
}
20+
21+
predicate allowedSourceFile(File file) { file.getBaseName() != "fd_types.c" }
22+
23+
class BroadAssign extends Locatable {
24+
BroadAssign() { this instanceof Variable or this instanceof AssignExpr }
25+
26+
Expr getRExpr() {
27+
result = this.(Variable).getInitializer().getExpr() or
28+
result = this.(AssignExpr).getRValue()
29+
}
30+
31+
Type getLType() {
32+
result = this.(Variable).getType() or
33+
result = this.(AssignExpr).getLValue().getType()
34+
}
35+
36+
Type getRType() { result = this.getRExpr().getType() }
37+
}
38+
39+
from BroadAssign assign
40+
where
41+
implicitVoidPromotion(assign.getLType(), assign.getRType()) and
42+
allowedSourceFile(assign.getLocation().getFile()) and
43+
not assign.getRExpr().isInMacroExpansion() and
44+
not assign.getRExpr().hasExplicitConversion() and
45+
not assign.getRExpr().(FunctionCall).getTarget().getName().matches("fd_type_pun%")
46+
select assign, "Implicit conversion from void * to " + assign.getLType()

contrib/codeql/nightly/TrivialMemcpy.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
to weaker typing.
77
* @kind problem
88
* @id firedancer-io/trivial-memcpy
9-
* @problem.severity none
9+
* @problem.severity recommendation
1010
* @precision high
1111
* @tags maintainability
1212
* readability

contrib/codeql/nightly/WrongUnused.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @id asymmetric-research/used-unused-param
55
* @kind problem
66
* @precision high
7-
* @problem.severity none
7+
* @problem.severity recommendation
88
*/
99

1010
import cpp

contrib/offline-replay/offline_replay_network_parameters.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ case $network in
1818
export BACKTEST_FUNK_PAGES=900
1919
export INDEX_MAX=1000000000
2020
export PAGES=250
21-
export AGAVE_TAG=v2.2.16
22-
export FD_CLUSTER_VERSION=2.2.16
21+
export AGAVE_TAG=v2.3.6
22+
export FD_CLUSTER_VERSION=2.3.6
2323
;;
2424
"testnet")
2525
export BUCKET_ENDPOINT="gs://testnet-ledger-us-sv15"
@@ -29,8 +29,8 @@ case $network in
2929
export BACKTEST_FUNK_PAGES=200
3030
export INDEX_MAX=200000000
3131
export PAGES=250
32-
export AGAVE_TAG=v2.3.0
33-
export FD_CLUSTER_VERSION=2.3.0
32+
export AGAVE_TAG=v2.3.6
33+
export FD_CLUSTER_VERSION=2.3.6
3434
;;
3535
"devnet")
3636
export BUCKET_ENDPOINT="gs://solana-devnet-ledger-us-ny5"
@@ -40,8 +40,8 @@ case $network in
4040
export BACKTEST_FUNK_PAGES=500
4141
export INDEX_MAX=200000000
4242
export PAGES=250
43-
export AGAVE_TAG=v2.2.16
44-
export FD_CLUSTER_VERSION=2.2.16
43+
export AGAVE_TAG=v2.3.6
44+
export FD_CLUSTER_VERSION=2.3.6
4545
;;
4646
*)
4747
echo "Unknown network: $network"

contrib/quic/rust_compat/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bindgen = "0.71"
1111
[dependencies]
1212
env_logger = "0"
1313
libc = "0.2"
14-
quiche = { version = "0.22", features = ["qlog"] }
14+
quiche = { version = "0.24.5", features = ["qlog"] }
1515
quinn = { version = "0.11", features = ["rustls-aws-lc-rs", "rustls-ring"] }
1616
rustls = { version = "0.23", features = ["aws_lc_rs", "ring"] }
1717
rustls-post-quantum = "0.2.1"

contrib/quic/rust_compat/src/quiche.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub(crate) unsafe fn quiche_to_fdquic() {
102102
assert!(metrics.net_rx_pkt_cnt < 64);
103103
assert!(metrics.net_tx_pkt_cnt < metrics.net_rx_pkt_cnt);
104104
assert!(metrics.net_tx_byte_cnt < metrics.net_rx_byte_cnt);
105-
assert!(metrics.conn_active_cnt <= 1);
105+
assert!(metrics.conn_state_cnt[3] <= 1);
106106
assert!(metrics.conn_created_cnt == 1);
107107
assert!(metrics.conn_closed_cnt <= 1);
108108
assert!(metrics.conn_aborted_cnt <= 1);

contrib/quic/rust_compat/src/quinn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub(crate) unsafe fn quinn_to_fdquic(crypto_provider: CryptoProvider) {
151151
assert!(metrics.net_rx_pkt_cnt < 64);
152152
assert!(metrics.net_tx_pkt_cnt <= metrics.net_rx_pkt_cnt);
153153
assert!(metrics.net_tx_byte_cnt < metrics.net_rx_byte_cnt);
154-
assert!(metrics.conn_active_cnt <= 1);
154+
assert!(metrics.conn_state_cnt[3] <= 1);
155155
assert!(metrics.conn_created_cnt == 1);
156156
assert!(metrics.conn_closed_cnt <= 1);
157157
assert!(metrics.conn_aborted_cnt <= 1);

src/ballet/chacha20/Local.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
$(call add-hdrs,fd_chacha20.h fd_chacha20rng.h)
22
$(call add-objs,fd_chacha20rng,fd_ballet)
33

4+
ifdef FD_HAS_AVX512
5+
$(call add-objs,fd_chacha20_avx512,fd_ballet)
6+
endif
7+
48
ifdef FD_HAS_AVX
59
$(call add-objs,fd_chacha20_avx,fd_ballet)
610
endif

src/ballet/chacha20/fd_chacha20_avx.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99
static inline __attribute__((always_inline)) wu_t
1010
wu_rol8( wu_t x ) {
1111
wb_t const mask =
12-
wb( 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14,
13-
3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14 );
12+
wb_bcast_hex( 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14 );
1413
return _mm256_shuffle_epi8( x, mask );
1514
}
1615

1716
void
1817
fd_chacha20rng_refill_avx( fd_chacha20rng_t * rng ) {
1918

20-
/* This function should only be called if the buffer is empty. */
21-
assert( rng->buf_off == rng->buf_fill );
22-
2319
wu_t iv0 = wu_bcast( 0x61707865U );
2420
wu_t iv1 = wu_bcast( 0x3320646eU );
2521
wu_t iv2 = wu_bcast( 0x79622d32U );
@@ -105,7 +101,8 @@ fd_chacha20rng_refill_avx( fd_chacha20rng_t * rng ) {
105101

106102
/* Update ring buffer */
107103

108-
uint * out = (uint *)rng->buf;
104+
ulong slot = rng->buf_fill % (8*FD_CHACHA20_BLOCK_SZ);
105+
uint * out = (uint *)rng->buf + (slot*2*FD_CHACHA20_BLOCK_SZ);
109106
wu_st( out+0x00, c0 ); wu_st( out+0x08, c8 );
110107
wu_st( out+0x10, c1 ); wu_st( out+0x18, c9 );
111108
wu_st( out+0x20, c2 ); wu_st( out+0x28, cA );

0 commit comments

Comments
 (0)