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(fade-rate-v2): use filler endpoints instead of hashes #332

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/cron/fade-rate-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ async function main(metrics: MetricsLogger) {
const result = await fadesRepository.getFades();

if (result) {
const fillerHashes = webhookProvider.fillers();
const addressToFillerMap = await fillerAddressRepo.getAddressToFillerMap(fillerHashes);
const fillerEndpoints = webhookProvider.fillerEndpoints();
const addressToFillerMap = await fillerAddressRepo.getAddressToFillerMap(fillerEndpoints);
log.info({ addressToFillerMap }, 'address to filler map from dynamo');
const fillerTimestamps = await timestampDB.getFillerTimestampsMap(fillerHashes);
const fillerTimestamps = await timestampDB.getFillerTimestampsMap(fillerEndpoints);

// get fillers new fades from last checked timestamp:
// | hash | faded | postTimestamp |
Expand Down
4 changes: 4 additions & 0 deletions lib/providers/webhook/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export class S3WebhookConfigurationProvider implements WebhookConfigurationProvi
return [...new Set(this.endpoints.map((endpoint) => endpoint.hash))];
}

fillerEndpoints(): string[] {
return this.endpoints.map((endpoint) => endpoint.endpoint);
}

async addressToFillerHash(): Promise<Map<string, string>> {
const map = new Map<string, string>();
if (this.endpoints.length === 0) {
Expand Down
Loading