Merged
Conversation
Deploying happychain with
|
| Latest commit: |
79781af
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6e6d3c71.happychain.pages.dev |
| Branch Preview URL: | https://gabriel-fix-faucet.happychain.pages.dev |
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
norswap
reviewed
Aug 1, 2025
| export FUND_THRESHOLD=10000000000000000 | ||
| export MONITOR_ADDRESSES=0x10EBe5E4E8b4B5413D8e1f91A21cE4143B6bd8F5,0x3cBD2130C2D4D6aDAA9c9054360C29e00d99f0BA,0xBAc858b1AD51527F3c4A22f146246c9913e97cFd,0x84dcb507875af1786bb6623a625d3f9aae9fda4f,0xAE45fD410bf09f27DA574D3EF547567A479F4594,0x71E30C67d58015293f452468E4754b18bAFFd807,0xE55b09F1b78B72515ff1d1a0E3C14AD5D707fdE8,0x634de6fbFfE60EE6D1257f6be3E8AF4CfefEf697,0xe8bD127b013600E5c6f864e5C07E918fa80BFF89 | ||
| export FUND_THRESHOLD=100000000000000000 | ||
| export FUNDS_TO_SEND=10000000000000000 |
Collaborator
There was a problem hiding this comment.
Suggested change
| export FUNDS_TO_SEND=10000000000000000 | |
| export FUNDS_TO_SEND=100000000000000000 |
Let's also increase the funds to send to 0.1 HAPPY — this will avoid topping up the faucet every time someone pulls from it (the faucet sents 0.01 HAPPY), instead topping up once every 10 pulls.
norswap
reviewed
Aug 1, 2025
packages/txm/lib/TxMonitor.ts
Outdated
Comment on lines
+375
to
+384
| if (transaction.collectionBlock && transaction.collectionBlock > block.number - 5n) { | ||
| // Skip transactions collected in the last 5 blocks to prevent race conditions between | ||
| // the transaction collector and monitor processing the same transaction simultaneously | ||
| span.addEvent("txm.tx-monitor.handle-not-attempted-transaction.skip-transaction", { | ||
| transactionIntentId: transaction.intentId, | ||
| collectionBlock: Number(transaction.collectionBlock), | ||
| blockNumber: Number(block.number), | ||
| }) | ||
| return | ||
| } |
Collaborator
There was a problem hiding this comment.
Waiting 5 blocks might introduce a lot of lag in our retries.
I'm retooling this so that we mark transaction that haven't gone through the initial submission as a new TransactionStatus.NotAttempted and we filter to not process these transactions in the TxMonitor.
9d2cfcf to
2a4bb9f
Compare
norswap
approved these changes
Aug 3, 2025
…hang as we hoped)
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.

Description
This PR solves multiple issues in the faucet:
The first issue was that the faucet wasn't being monitored by the monitor service, so ironically it ran out of funds.
Another issue fixed was that the faucet was limiting usage based on both successful and failed transactions. Now it only considers successful transactions.
The threshold in the monitor service was increased because it was previously equal to the amount of tokens sent per request. This could cause problems if multiple users requested funds at the same time.
A race condition was fixed in the transaction manager (TXM) where the same transaction was sent multiple times. This caused the faucet to occasionally send duplicate transactions for a single request. The issue occurred because the transaction was being monitored in the TXM before the collection process had fully completed.
TXM traces are now exported from the faucet to allow debugging in case of issues.
Toggle Checklist
Checklist
Basics
norswap/build-system-caching).Reminder: PR review guidelines
Correctness
testnet, mainnet, standalone wallet, ...).
< INDICATE BROWSER, DEMO APP & OTHER ENV DETAILS USED FOR TESTING HERE >
< INDICATE TESTED SCENARIOS (USER INTERFACE INTERACTION, CODE FLOWS) HERE >
and have updated the code & comments accordingly.
Architecture & Documentation
(2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
Public APIS and meaningful (non-local) internal APIs are properly documented in code comments.
in a Markdown document.
make changesetforbreaking and meaningful changes in packages (not required for cleanups & refactors).