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

minor improvements to faucet worker #3062

Merged
merged 7 commits into from
Feb 1, 2023
Merged

minor improvements to faucet worker #3062

merged 7 commits into from
Feb 1, 2023

Conversation

cbeck88
Copy link
Contributor

@cbeck88 cbeck88 commented Jan 27, 2023

No description provided.

@cbeck88 cbeck88 requested review from jcape, eranrund, jgreat, wjuan-mob, a team and NotGyro and removed request for a team January 27, 2023 23:44
@cbeck88 cbeck88 requested a review from wjuan-mob January 28, 2023 00:24
wjuan-mob
wjuan-mob previously approved these changes Jan 28, 2023
@jgreat
Copy link
Contributor

jgreat commented Jan 30, 2023

The CD failure here seems to happen a whole lot more after we integrated the faucet. The cd-integration-tests stalls out on one of the python scripts that sets up monitors waiting for the blocks to sync. Mobilecoind doesn't show any errors when this happens. I'm guessing some kind of weirdness/race when multiple clients are trying to watch monitors?

@cbeck88
Copy link
Contributor Author

cbeck88 commented Jan 30, 2023

I would kind of like to lean into the faucet and not use "drain accounts"? What do you think about that?

@cbeck88
Copy link
Contributor Author

cbeck88 commented Jan 31, 2023

Maybe it will be better with the "activate" option? So the faucet wont do anything while drain accounts is trying to work? #3063

cbeck88 and others added 4 commits January 31, 2023 13:36
This rearranges some of the code that talks to mobilecoind in a
way that I think should reduce some racy error conditions.

It also renames a variable to be more clear, the old name doesn't
make as much sense anymore.

This was tested locally against

```
diff --git a/mobilecoind/src/sync.rs b/mobilecoind/src/sync.rs
index b78be780a..8f166fa85 100644
--- a/mobilecoind/src/sync.rs
+++ b/mobilecoind/src/sync.rs
@@ -299,6 +299,8 @@ fn sync_monitor(
         let block_contents = match ledger_db.get_block_contents(monitor_data.next_block) {
             Ok(block_contents) => block_contents,
             Err(mc_ledger_db::Error::NotFound) => {
+                // Fake S3 delay
+                std::thread::sleep(std::time::Duration::from_secs(1));
                 return Ok(SyncMonitorOk::NoMoreBlocks);
             }
             Err(err) => {
```

to try to simulate S3 delay.
I don't think this should be necessary, but I'm somewhat out of
ideas. It can't hurt and may prevent an error I guess.
@cbeck88 cbeck88 changed the base branch from release/v4.0 to release/v4.1 January 31, 2023 20:36
@cbeck88 cbeck88 dismissed wjuan-mob’s stale review January 31, 2023 20:36

The base branch was changed.

cbeck88 and others added 2 commits January 31, 2023 14:13
Jason requested that, the mobilecoind-dev-faucet should not immediately
start sending lots of transactions after it is deployed, because that
makes some other deployment-related things harder. By default it does
that because it wants to have its queue full.

The change we made is:

* The faucet worker now has an "in_active" flag, which if false causes
  it to skip its loop, and this defaults to false.
* The flag is set to true if `--activate` is passed.
* If `--activate` is passed, the flag is set true whenever an HTTP POST
  occurs (post to get payment from faucet, or to start a slam), whether
  or not the POST results in a successful operation.
* Docu is updated so that for dev testing it demonstrates `--activate`
  and the existing documented flows should still work.
* CI is updated to use `--activate`
@cbeck88 cbeck88 requested a review from wjuan-mob January 31, 2023 22:28
@cbeck88 cbeck88 requested a review from wjuan-mob January 31, 2023 23:55
@cbeck88 cbeck88 merged commit 2df76c5 into release/v4.1 Feb 1, 2023
@cbeck88 cbeck88 deleted the fixups-to-slam branch February 1, 2023 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants