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

feat: create llm basic dispute bot #4630

Merged
merged 5 commits into from
Sep 3, 2023

Conversation

md0x
Copy link
Contributor

@md0x md0x commented Aug 30, 2023

Motivation

This is a basic LLM dispute bot scaffolding to be completed once we have LLM strategies. Depends on #4629

Testing

Check a box to describe how you tested these changes and list the steps for reviewers to test.

  • Ran end-to-end test, running the code as in production
  • New unit tests created
  • Existing tests adequate, no new tests required
  • All existing tests pass
  • Untested

Issue(s)

Fixes #XXXX

@linear
Copy link

linear bot commented Aug 30, 2023

UMA-1760 Create LLM dispute bot wrapper base

Create a base to run bot that can be run in our infrastructure, with a signer that can use the LLM modules to dispute requests when necessary.

@md0x md0x changed the title feat: create llm dispute bot wrapper base feat: create llm basic dispute bot Aug 30, 2023
@md0x md0x marked this pull request as ready for review August 30, 2023 14:54
@md0x md0x requested a review from daywiss August 30, 2023 16:06
Copy link
Member

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

Looks great! Only minor nits and comments about future development/follow-ups!

} from "../core/OptimisticOracleV2";
import { Logger, MonitoringParams } from "./common";

export async function disputeDisputableRequests(logger: typeof Logger, params: MonitoringParams): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

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

This is really cool how simple this turned out! I think there's some more we can do to generalize the "runner" so a user can configure each part of the pipeline independently (like swap out the filter purely via the env or cli args, for instance), but I think that's probably something to do in a future PR. This is perfect!


const filteredRequests = await oov2FilterDisputable.filter(requests);

const disputable = await Promise.all(filteredRequests.map(DisputerStrategy.process));
Copy link
Member

Choose a reason for hiding this comment

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

Is process() a static method on DisputerStrategy? Are all strategies intended to be built that way? Seems like stated unless might ultimately be necessary for future (non trivial) strategies. Either way, that's something we can worry about in a follow up PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

can any of these calls error? i usually try to avoid processing things in a list like this since errors can prevent some from executing. if no errors are expected though this is fine

pollingDelay: number;
}

export const initMonitoringParams = async (env: NodeJS.ProcessEnv): Promise<MonitoringParams> => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: monitoring -> bot (or LLMBot)

@@ -0,0 +1,27 @@
# LLM Dispute Bot
Copy link
Member

Choose a reason for hiding this comment

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

As usual, 👌 documentation!

Copy link
Contributor

@daywiss daywiss left a comment

Choose a reason for hiding this comment

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

came together really nice


const filteredRequests = await oov2FilterDisputable.filter(requests);

const disputable = await Promise.all(filteredRequests.map(DisputerStrategy.process));
Copy link
Contributor

Choose a reason for hiding this comment

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

can any of these calls error? i usually try to avoid processing things in a list like this since errors can prevent some from executing. if no errors are expected though this is fine

timer: TimerEthers;
}

export const umaEcosystemFixture = hre.deployments.createFixture(
Copy link
Contributor

Choose a reason for hiding this comment

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

this was a lot of work just to set up the testing! is this something we would want to reuse?

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
@md0x md0x force-pushed the pablo/uma-1760-create-llm-dispute-bot-wrapper-base branch from dabe696 to 12a02dc Compare September 3, 2023 19:02
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
@md0x md0x merged commit 609a68a into master Sep 3, 2023
7 checks passed
@md0x md0x deleted the pablo/uma-1760-create-llm-dispute-bot-wrapper-base branch September 3, 2023 19:57
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.

3 participants