Skip to content

Commit

Permalink
debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Oct 16, 2024
1 parent 95fe260 commit 3be8cbf
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
39 changes: 39 additions & 0 deletions protocol/recover_mnemonics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
echo "merge panther lobster crazy road hollow amused security before critic about cliff exhibit cause coyote talent happy where lion river tobacco option coconut small" | \
./build/dydxprotocold keys add alice --recover --keyring-backend test

echo "color habit donor nurse dinosaur stable wonder process post perfect raven gold census inside worth inquiry mammal panic olive toss shadow strong name drum" | \
./build/dydxprotocold keys add bob --recover --keyring-backend test

echo "school artefact ghost shop exchange slender letter debris dose window alarm hurt whale tiger find found island what engine ketchup globe obtain glory manage" | \
./build/dydxprotocold keys add carl --recover --keyring-backend test

echo "switch boring kiss cash lizard coconut romance hurry sniff bus accident zone chest height merit elevator furnace eagle fetch quit toward steak mystery nest" | \
./build/dydxprotocold keys add dave --recover --keyring-backend test

echo "brave way sting spin fog process matrix glimpse volcano recall day lab raccoon hand path pig rent mixture just way blouse alone upon prefer" | \
./build/dydxprotocold keys add emily --recover --keyring-backend test

echo "suffer claw truly wife simple mean still mammal bind cake truly runway attack burden lazy peanut unusual such shock twice appear gloom priority kind" | \
./build/dydxprotocold keys add fiona --recover --keyring-backend test

echo "step vital slight present group gallery flower gap copy sweet travel bitter arena reject evidence deal ankle motion dismiss trim armed slab life future" | \
./build/dydxprotocold keys add greg --recover --keyring-backend test

echo "piece choice region bike tragic error drive defense air venture bean solve income upset physical sun link actor task runway match gauge brand march" | \
./build/dydxprotocold keys add henry --recover --keyring-backend test

echo "burst section toss rotate law thumb shoe wire only decide meadow aunt flight humble story mammal radar scene wrist essay taxi leisure excess milk" | \
./build/dydxprotocold keys add ian --recover --keyring-backend test

echo "fashion charge estate devote jaguar fun swift always road lend scrap panic matter core defense high gas athlete permit crane assume pact fitness matrix" | \
./build/dydxprotocold keys add jeff --recover --keyring-backend test

echo "aspect visit helmet seed door town weird maze upper gadget nice coach cat process portion original upset toilet depart allow misery goddess border filter" | \
./build/dydxprotocold keys add faucet --recover --keyring-backend test

echo "artwork permit inmate foil force two ordinary wool flame shoulder kind nerve battle knee differ evoke shaft panda steel verb duck asset absorb quality" | \
./build/dydxprotocold keys add dydx-1 --recover --keyring-backend test

echo "indoor hybrid main praise detail snack brief submit level toward attend embody country sing much vivid goose endless primary gaze blanket session fluid rather" | \
./build/dydxprotocold keys add dydx-2 --recover --keyring-backend test

8 changes: 7 additions & 1 deletion protocol/streaming/full_node_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ func (sm *FullNodeStreamingManagerImpl) Subscribe(
issuedSubscriptionId += 1
}

sm.logger.Info(fmt.Sprintf("Proceeding with subscription id %+v", issuedSubscriptionId))

subscription := &OrderbookSubscription{
subscriptionId: issuedSubscriptionId,
initialized: &atomic.Bool{}, // False by default.
Expand Down Expand Up @@ -225,9 +227,11 @@ func (sm *FullNodeStreamingManagerImpl) Subscribe(
),
)
sm.orderbookSubscriptions[subscription.subscriptionId] = subscription
sm.activeSubscriptionIds[issuedSubscriptionId] = struct{}{}
sm.activeSubscriptionIds[subscription.subscriptionId] = struct{}{}
sm.logger.Info(fmt.Sprintf("added to active set %+v", sm.activeSubscriptionIds))
sm.EmitMetrics()
sm.Unlock()
sm.logger.Info(fmt.Sprintf("done adding %+v, startign poller", subscription.subscriptionId))

// Use current goroutine to consistently poll subscription channel for updates
// to send through stream.
Expand Down Expand Up @@ -308,7 +312,9 @@ func (sm *FullNodeStreamingManagerImpl) removeSubscription(
}
}

sm.logger.Info(fmt.Sprintf("clearing subscription id %+v", subscriptionIdToRemove))
delete(sm.activeSubscriptionIds, subscriptionIdToRemove)
sm.logger.Info(fmt.Sprintf("done clearing subscription id %+v", subscriptionIdToRemove))

sm.logger.Info(
fmt.Sprintf("Removed streaming subscription id %+v", subscriptionIdToRemove),
Expand Down

0 comments on commit 3be8cbf

Please sign in to comment.