Skip to content

Commit b6076b9

Browse files
committed
fix: expose locally-overriden hint-replicas data for each stackerdb replica
1 parent 7267cd0 commit b6076b9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

stackslib/src/net/connection.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
use std::collections::VecDeque;
17+
use std::collections::{HashMap, VecDeque};
1818
use std::io::{Read, Write};
1919
use std::ops::{Deref, DerefMut};
2020
use std::sync::mpsc::{
@@ -24,7 +24,7 @@ use std::time::Duration;
2424
use std::{io, net};
2525

2626
use clarity::vm::costs::ExecutionCost;
27-
use clarity::vm::types::BOUND_VALUE_SERIALIZATION_HEX;
27+
use clarity::vm::types::{QualifiedContractIdentifier, BOUND_VALUE_SERIALIZATION_HEX};
2828
use stacks_common::codec::{StacksMessageCodec, MAX_MESSAGE_LEN};
2929
use stacks_common::types::net::PeerAddress;
3030
use stacks_common::util::hash::to_hex;
@@ -44,7 +44,8 @@ use crate::net::neighbors::{
4444
WALK_SEED_PROBABILITY, WALK_STATE_TIMEOUT,
4545
};
4646
use crate::net::{
47-
Error as net_error, MessageSequence, Preamble, ProtocolFamily, RelayData, StacksHttp, StacksP2P,
47+
Error as net_error, MessageSequence, NeighborAddress, Preamble, ProtocolFamily, RelayData,
48+
StacksHttp, StacksP2P,
4849
};
4950

5051
/// Receiver notification handle.
@@ -433,6 +434,8 @@ pub struct ConnectionOptions {
433434
pub nakamoto_unconfirmed_downloader_interval_ms: u128,
434435
/// The authorization token to enable privileged RPC endpoints
435436
pub auth_token: Option<String>,
437+
/// StackerDB replicas to talk to for a particular smart contract
438+
pub stackerdb_hint_replicas: HashMap<QualifiedContractIdentifier, Vec<NeighborAddress>>,
436439

437440
// fault injection
438441
/// Disable neighbor walk and discovery
@@ -565,6 +568,7 @@ impl std::default::Default for ConnectionOptions {
565568
nakamoto_inv_sync_burst_interval_ms: 1_000, // wait 1 second after a sortition before running inventory sync
566569
nakamoto_unconfirmed_downloader_interval_ms: 5_000, // run unconfirmed downloader once every 5 seconds
567570
auth_token: None,
571+
stackerdb_hint_replicas: HashMap::new(),
568572

569573
// no faults on by default
570574
disable_neighbor_walk: false,

0 commit comments

Comments
 (0)