Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: variable names and event handling logic #2421

Closed
wants to merge 10 commits into from
2 changes: 1 addition & 1 deletion apps/hubble/src/hubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ export class Hub implements HubInterface {
this.options.allowlistedImmunePeers,
this.options.strictContactInfoValidation,
this.options.strictNoSign,
this.engine.solanaVerficationsEnabled,
this.engine.solanaVerificationsEnabled,
this.options.useStreaming,
);

Expand Down
2 changes: 1 addition & 1 deletion apps/hubble/src/network/sync/syncEngine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ describe("SyncEngine", () => {
const result = await syncEngine.mergeMessages([castAdd], rpcClient);
expect(result.successCount).toEqual(1);

// Should sync should return true becuase the excluded hashes don't match
// Should sync should return true because the excluded hashes don't match
expect(oldSnapshot.excludedHashes).not.toEqual((await syncEngine.getSnapshot())._unsafeUnwrap().excludedHashes);
expect((await syncEngine.syncStatus("test", oldSnapshot))._unsafeUnwrap().shouldSync).toBeTruthy();

Expand Down
4 changes: 2 additions & 2 deletions apps/hubble/src/profile/gossipProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export enum ProfileWorkerAction {
WaitForMessages = 3,
Stop = 4,
GetMultiAddres = 5,
ConnectToMutliAddr = 6,
ConnectToMultiAddr = 6,
ReportPeers = 7,
}

Expand Down Expand Up @@ -104,7 +104,7 @@ export async function profileGossipServer(nodeConfig = "3:10") {
const workerResponse = await callWorkerMethod(workers[i - 1] as Worker, ProfileWorkerAction.GetMultiAddres);
const prevMultiAddrs = workerResponse.response as MultiAddrResponse;

await callWorkerMethod(workers[i] as Worker, ProfileWorkerAction.ConnectToMutliAddr, {
await callWorkerMethod(workers[i] as Worker, ProfileWorkerAction.ConnectToMultiAddr, {
multiAddr: prevMultiAddrs?.multiAddrs ?? [],
});

Expand Down
2 changes: 1 addition & 1 deletion apps/hubble/src/profile/gossipProfileWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ parentPort?.on("message", (data) => {
} else if (action === ProfileWorkerAction.GetMultiAddres) {
const response = getMultiAddrs();
parentPort?.postMessage({ id, action, response });
} else if (action === ProfileWorkerAction.ConnectToMutliAddr) {
} else if (action === ProfileWorkerAction.ConnectToMultiAddr) {
const { multiAddr } = args as ConnectToMultiAddrArgs;
connectToMultiAddr(multiAddr);

Expand Down
12 changes: 6 additions & 6 deletions apps/hubble/src/storage/engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class Engine extends TypedEmitter<EngineEvents> {

private _totalPruneSize: number;

private _solanaVerficationsEnabled = false;
private _solanaVerificationsEnabled = false;

private _fNameRetryRateLimiter = new RateLimiterMemory({ points: 60, duration: 60 }); // 60 retries per minute allowed

Expand Down Expand Up @@ -272,13 +272,13 @@ class Engine extends TypedEmitter<EngineEvents> {
this._onchainEventsStore.clearCaches();
}

get solanaVerficationsEnabled(): boolean {
return this._solanaVerficationsEnabled;
get solanaVerificationsEnabled(): boolean {
return this._solanaVerificationsEnabled;
}

setSolanaVerifications(enabled: boolean) {
if (this._solanaVerficationsEnabled !== enabled) {
this._solanaVerficationsEnabled = enabled;
if (this._solanaVerificationsEnabled !== enabled) {
this._solanaVerificationsEnabled = enabled;
logger.info(`Solana verifications toggled to: ${enabled}`);
}
}
Expand Down Expand Up @@ -1317,7 +1317,7 @@ class Engine extends TypedEmitter<EngineEvents> {
isVerificationAddAddressMessage(message) &&
message.data.verificationAddAddressBody.protocol === Protocol.SOLANA
) {
if (!this._solanaVerficationsEnabled) {
if (!this._solanaVerificationsEnabled) {
return err(new HubError("bad_request.validation_failure", "solana verifications are not enabled"));
}
}
Expand Down
8 changes: 4 additions & 4 deletions apps/hubble/src/storage/stores/rustStoreBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export abstract class RustStoreBase<TAdd extends Message, TRemove extends Messag
mergeResults.set(i, err(result.error));
} else {
const hubEvent = HubEvent.decode(new Uint8Array(result.value));
void this._eventHandler.processRustCommitedTransaction(hubEvent);
void this._eventHandler.processRustCommittedTransaction(hubEvent);
mergeResults.set(i, ok(hubEvent.id));
}
}
Expand Down Expand Up @@ -148,7 +148,7 @@ export abstract class RustStoreBase<TAdd extends Message, TRemove extends Messag
const resultBytes = new Uint8Array(result.value);
const hubEvent = HubEvent.decode(resultBytes);

void this._eventHandler.processRustCommitedTransaction(hubEvent);
void this._eventHandler.processRustCommittedTransaction(hubEvent);
return hubEvent.id;
}

Expand All @@ -162,7 +162,7 @@ export abstract class RustStoreBase<TAdd extends Message, TRemove extends Messag
const resultBytes = new Uint8Array(result.value);
const hubEvent = HubEvent.decode(resultBytes);

void this._eventHandler.processRustCommitedTransaction(hubEvent);
void this._eventHandler.processRustCommittedTransaction(hubEvent);
return ok(hubEvent.id);
}

Expand Down Expand Up @@ -201,7 +201,7 @@ export abstract class RustStoreBase<TAdd extends Message, TRemove extends Messag
for (const resultBytes of result.value) {
const hubEvent = HubEvent.decode(new Uint8Array(resultBytes));
commits.push(hubEvent.id);
void this._eventHandler.processRustCommitedTransaction(hubEvent);
void this._eventHandler.processRustCommittedTransaction(hubEvent);
}

return ok(commits);
Expand Down
2 changes: 1 addition & 1 deletion apps/hubble/src/storage/stores/storeEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class StoreEventHandler extends TypedEmitter<StoreEvents> {
});
}

async processRustCommitedTransaction(event: HubEvent): HubAsyncResult<void> {
async processRustCommittedTransaction(event: HubEvent): HubAsyncResult<void> {
void this._storageCache.processEvent(event);
void this.broadcastEvent(event);
return ok(undefined);
Expand Down
2 changes: 1 addition & 1 deletion apps/hubble/src/storage/stores/userDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class UserDataStore extends RustStoreBase<UserDataAddMessage, never> {
const resultBytes = new Uint8Array(result.value);
const hubEvent = HubEvent.decode(resultBytes);

void this._eventHandler.processRustCommitedTransaction(hubEvent);
void this._eventHandler.processRustCommittedTransaction(hubEvent);
return hubEvent.id;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/shuttle/src/shuttle.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ describe("shuttle", () => {
}),
);
},
getAllVerficationMessagesByFid: async (
getAllVerificationMessagesByFid: async (
_request: FidRequest,
_metadata: Metadata,
_options: Partial<CallOptions>,
Expand Down
Loading