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

Serge/liquidator split tcs and liquidation #914

Merged
merged 20 commits into from
Mar 20, 2024

Conversation

farnyser
Copy link
Contributor

No description provided.

@farnyser farnyser requested a review from ckamm March 12, 2024 13:54
@github-actions github-actions bot added dependency Dependency updates program On-chain program changes labels Mar 12, 2024
bin/liquidator/src/main.rs Outdated Show resolved Hide resolved
bin/liquidator/src/main.rs Outdated Show resolved Hide resolved
bin/liquidator/src/main.rs Show resolved Hide resolved
bin/liquidator/src/main.rs Outdated Show resolved Hide resolved
bin/liquidator/src/main.rs Outdated Show resolved Hide resolved
bin/liquidator/src/liquidation_state.rs Outdated Show resolved Hide resolved
bin/liquidator/src/main.rs Show resolved Hide resolved
bin/liquidator/src/trigger_tcs.rs Outdated Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Outdated Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Outdated Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Outdated Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Outdated Show resolved Hide resolved
lib/client/src/util.rs Outdated Show resolved Hide resolved
bin/liquidator/src/liquidation_state.rs Outdated Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Outdated Show resolved Hide resolved
bin/liquidator/src/liquidation_state.rs Outdated Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Outdated Show resolved Hide resolved
@farnyser farnyser force-pushed the serge/liquidator-split-tcs-and-liquidation branch from d19ccd3 to 3894d8f Compare March 18, 2024 16:13
@farnyser farnyser force-pushed the serge/liquidator-split-tcs-and-liquidation branch from 3894d8f to 020252b Compare March 19, 2024 07:48
@github-actions github-actions bot added the client TS client changes label Mar 19, 2024
lib/client/src/client.rs Outdated Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Show resolved Hide resolved
bin/liquidator/src/tx_sender.rs Outdated Show resolved Hide resolved
// a task must be available to process
// find it in global shared state, and mark it as processing
let task = worker_pull_task(&shared_state, id, tcs_capable_workers, only_liquidation)
.expect("Worker woke up but has nothing to do");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think with the tcs batching pulled back in, this no longer works. You send a trigger for each tcs candidate, but the processing tasks eat up multiple at once - so for N candidates the there'll be fewer than N worker tasks.

There's also some weirdness now where the tcs jobs trigger on the tcs channel and take all the liquidation jobs and then the liquidation job wakes up (on the liq channel) and has no work to do.

It may be more robust to avoid the requirement that the number of messages on the channels and the number of work chunks match up exactly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It "works" because the TCS task will just be made of an empty vector (no candidate) if everything was consumed before

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see! Would you be up for making it more explicit by adding a no-work WorkerTask?

// a task must be available to process
// find it in global shared state, and mark it as processing
let task = worker_pull_task(&shared_state, id, tcs_capable_workers, only_liquidation)
.expect("Worker woke up but has nothing to do");
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see! Would you be up for making it more explicit by adding a no-work WorkerTask?

@farnyser farnyser merged commit f54bb6f into dev Mar 20, 2024
23 checks passed
@farnyser farnyser deleted the serge/liquidator-split-tcs-and-liquidation branch March 20, 2024 14:25
farnyser added a commit that referenced this pull request Aug 9, 2024
liquidator: split TCS triggering and liquidation job

Concurrent execution of candidate lookup and tx building/sending
- Also added an health assertion IX to protect liqor in multi liquidation scenario
- And a timeout for jupiter v6 queries (avoid blocking liquidation because of slow TCS)
farnyser added a commit that referenced this pull request Aug 10, 2024
liquidator: split TCS triggering and liquidation job

Concurrent execution of candidate lookup and tx building/sending
- Also added an health assertion IX to protect liqor in multi liquidation scenario
- And a timeout for jupiter v6 queries (avoid blocking liquidation because of slow TCS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client TS client changes dependency Dependency updates program On-chain program changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants