Repository navigation
fix(backend): no default encryption key, single pool escrow, shared platform cache, atomic user creation - #896
Merged
chonilius merged 2 commits intoNov 20, 2026
Conversation
…latform cache, atomic user creation - encryption: remove the committed fallback AES key. ENCRYPTION_KEY must be set in every environment. - maintenance pool: deposits go to the existing pool escrow via EscrowService.depositToPool, not a new fund() row. - analytics: drop the process-local platform cache and its invalidation listener. The endpoint sends a shared Cache-Control header. - users: the User and GithubAccount are saved in one transaction. A username clash retries the whole transaction. Closes MergeFi#781 Closes MergeFi#782 Closes MergeFi#788 Closes MergeFi#789
|
@maikNeta is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@maikNeta Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes four issues in one PR.
encryption.transformer.ts.ENCRYPTION_KEYmust now be set in every environment, not only in production, or the transformer throws. Before, any non-production deployment encrypted OAuth tokens with a key that is in the public history.EscrowService.depositToPool(escrowId, …). It invokes the pool contract'sdepositon the pool's existing escrow row under the row lock. Before, each deposit calledfund()and created a new escrow row.TtlCacheand its invalidation listener are removed fromAnalyticsService.GET /analytics/platformsendsCache-Control: public, s-maxage=60, stale-while-revalidate=30, so a shared cache holds one copy.upsertFromGithubsaves the newUserand itsGithubAccountin onetransaction. A username clash rolls back and retries the whole transaction with a random suffix.Limitations, read before merging
fund()once, before the conditional update. That creates one orphaned escrow row, and it is locked on-chain. Removing it needs a reservation step before the on-chain call, which is a larger change and is not in this PR.GithubAccounttoken written under the committed key is exposed. SetENCRYPTION_KEYto a new value and re-encrypt those rows. This PR does not do the migration.ENCRYPTION_KEYis not in the boot-time config check.validate-required-config.tsandAppConfigare unchanged, so a missing key fails on first use rather than at startup.ANALYTICS_PLATFORM_SUMMARY_TTL_MSis now unused. The config value is left in place. Remove it in a follow-up.s-maxage. Without a shared cache in front of the API, each replica still answers its own requests.Closes #781
Closes #782
Closes #788
Closes #789