Skip to content

chore: warmup middleware for authorization lambdas#287

Merged
r4mmer merged 8 commits intomasterfrom
feat/authorization-warmup
Sep 10, 2025
Merged

chore: warmup middleware for authorization lambdas#287
r4mmer merged 8 commits intomasterfrom
feat/authorization-warmup

Conversation

@r4mmer
Copy link
Copy Markdown
Member

@r4mmer r4mmer commented Sep 8, 2025

Motivation

Having both the auth token api and the authorizer lambda cold start at the same time increases the wallet start by more than 2 seconds.
Having them always be warmed would improve the UX.

Acceptance Criteria

  • Add the warmup middleware for both the auth token api and authorizer lambda

Extra chores

  • Added missing error treatment in auth token api
  • Fixed fullnode event parser
  • Prevent the get new addresses to fetch the same walet twice from the database.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged
  • Make sure either the unit tests and/or the QA tests are capable of testing the new features
  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@r4mmer r4mmer self-assigned this Sep 8, 2025
@r4mmer r4mmer moved this from Todo to In Progress (Done) in Hathor Network Sep 8, 2025
Comment thread packages/daemon/src/types/event.ts Outdated
Comment on lines +108 to +110
z.object({
token_data: z.number().nullish(),
}).strict()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was an event from the simulator with { token_data: 0 } which would break the parser, so I added this option.

Copy link
Copy Markdown
Collaborator

@andreabadesso andreabadesso Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to be the same as yours since it acomplishes the same thing and makes conflict resolution easier

Comment on lines +87 to +96
if (!wallet) {
await closeDbConnection(mysql);
return {
statusCode: 400,
body: JSON.stringify({
success: false,
error: ApiError.WALLET_NOT_FOUND,
}),
};
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just including an error treatment in case we don't find the wallet.

pedroferreira1
pedroferreira1 previously approved these changes Sep 9, 2025
@pedroferreira1 pedroferreira1 moved this from In Progress (Done) to In Review (WIP) in Hathor Network Sep 9, 2025
andreabadesso
andreabadesso previously approved these changes Sep 10, 2025
@andreabadesso andreabadesso moved this from In Review (WIP) to In Review (Done) in Hathor Network Sep 10, 2025
pedroferreira1
pedroferreira1 previously approved these changes Sep 10, 2025
andreabadesso
andreabadesso previously approved these changes Sep 10, 2025
@github-project-automation github-project-automation Bot moved this from In Review (Done) to In Review (WIP) in Hathor Network Sep 10, 2025
@r4mmer r4mmer dismissed stale reviews from andreabadesso and pedroferreira1 via fdf6f14 September 10, 2025 18:26
@r4mmer r4mmer merged commit 352948c into master Sep 10, 2025
1 check passed
@github-project-automation github-project-automation Bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Sep 10, 2025
@r4mmer r4mmer deleted the feat/authorization-warmup branch September 10, 2025 20:47
@r4mmer r4mmer moved this from Waiting to be deployed to Done in Hathor Network Sep 12, 2025
This was referenced Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants