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: Notify if simulation succeeded at least once in the new API. #2280

Closed
marcovc opened this issue Jan 14, 2024 · 4 comments
Closed

feat: Notify if simulation succeeded at least once in the new API. #2280

marcovc opened this issue Jan 14, 2024 · 4 comments
Assignees

Comments

@marcovc
Copy link
Contributor

marcovc commented Jan 14, 2024

Problem

It is not clear to me where in the notify call to the new API :

c2a67c9#diff-2d7ec54baf3c2df9830102c6ad5c9662f82670d932b0e6eaccd4c87f4936a211R35-R62

I can access the information about if the simulation succeeded at least once (the purpose of this PR #2077) .

In case this information is not passed, I'd like to ask that this information is re-added back.

@fleupold
Copy link
Contributor

Here is an example notification I found in the logs (simulation succeeded once flag in bold):

result=Rejected(SimulationFailure(TransactionWithError { transaction: SimulatedTransaction { block_number: 19008999, tx_index: 0, internalization: Unknown, access_list: None, from: 0x3bf7c0e1728fb64bb0973b1e2a342f1c7eb1bb8e, to: 0x9008d19f58aabd9ed0d60971565aa8510560ab41, data: 0x13d79a0b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000def1ca1fb7fbcdc777520aa7f396b4e015f497ab0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000047a7316b1bec63cfd0905ab68d799300000000000000000000000000000000000000000000152d02c7e14af680000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b65eff428a3c224e7cacc547795d3c1f15fce79000000000000000000000000000000000000000000000000000000025be33aa10000000000000000000000000000000000000000000007f05a728e1dd77912720000000000000000000000000000000000000000000000000000000065a490d580c70dc11d88e529cfe4f465cbff241a43fc526ae7bb33678fa81f2bc448b4f0000000000000000000000000000000000000000000000000000000000111b2af0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025be33aa10000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000004190e7b09ad9b1f246a7319feac6d27f0bf9f671e794fedfab52c8fdadd67c50e727cb54fb48ac997de97c5c95980653cff5bb747ca5c45799cb6fe83473d6bd6e1c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000440000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000000d4a11d5eeaac28ec3f61d100daf4d40471f1852000000000000000000000000000000000000000000000000000000025be33aa100000000000000000000000000000000000000000000000000000000000000000000000000000000f4c0dd9b82da36c07605df83c8a416f11724d88b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002438e9922e000000000000000000000000000000000000000000000000000221b262dd8000000000000000000000000000000000000000000000000000000000000000000000000000000000002c6a3cd97c6283b95ac8c5a4459ebb0d5fd404f40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001843fe4b369000000000000000000000000000000000000000000000000000000025be33aa10000000000000000000000000000000000000000000007fb63421b10cc79270500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000100003200000000000000000d4a11d5eeaac28ec3f61d100daf4d40471f18522c6a3cd97c6283b95ac8c5a4459ebb0d5fd404f40000006404000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26810e776880c02933d47db1b9fc05908e5386b96f4c0dd9b82da36c07605df83c8a416f11724d88b0002000000000000000000262c6a3cd97c6283b95ac8c5a4459ebb0d5fd404f4000064040000000000006810e776880c02933d47db1b9fc05908e5386b96def1ca1fb7fbcdc777520aa7f396b4e015f497ab92762b42a06dcdddc5b7362cfb01e631c4d44b400002000000000000000001829008d19f58aabd9ed0d60971565aa8510560ab410000000000000000000000000000000000000000000000000000000000000000000000000000000000f4c0dd9b82da36c07605df83c8a416f11724d88b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002438e9922e000000000000000000000000000000000000000000000000000aa87bee53800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009447eb, max_fee_per_gas: 0, max_priority_fee_per_gas: 0 }, error: "" }, false))

If you are unable to see this field in your solver, can you please paste the full json of a SimulationFailure payload that you see?

@marcovc
Copy link
Contributor Author

marcovc commented Jan 15, 2024

Currently I am using the deprecated json API. In the schema for the new API, I don't see where this field is, and hence my question. It looks like it has just an enum specifying the type of simulation failure and no extra information. Asking because I need to adapt the code to the new API.

@fleupold
Copy link
Contributor

fleupold commented Jan 16, 2024

The enum fields aren't documented in detail here

enum: [Timeout, EmptySolution, DuplicatedSolutionId, SimulationFailed, ZeroScore, ScoreHigherThanQuality, SuccessProbabilityOutOfRange, ObjectiveValueNonPositive, NonBufferableTokensUsed, SolverAccountInsufficientBalance, Success, Revert, Cancelled, Failed, PostprocessingTimedOut]

but SimulationFailed should contain a field called succeededOnce .

pub enum Kind {
Timeout,
EmptySolution,
DuplicatedSolutionId,
#[serde(rename_all = "camelCase")]
SimulationFailed {
block: BlockNo,
tx: Tx,
succeeded_once: bool,
},
ZeroScore,
ScoreHigherThanQuality {
#[serde_as(as = "serialize::U256")]
score: U256,
#[serde_as(as = "serialize::U256")]
quality: U256,
},
SuccessProbabilityOutOfRange {
probability: f64,
},
#[serde(rename_all = "camelCase")]
ObjectiveValueNonPositive {
#[serde_as(as = "serialize::U256")]
quality: U256,
#[serde_as(as = "serialize::U256")]
gas_cost: U256,
},
NonBufferableTokensUsed {
tokens: BTreeSet<H160>,
},
SolverAccountInsufficientBalance {
#[serde_as(as = "serialize::U256")]
required: U256,
},
Success {
transaction: H256,
},
Revert {
transaction: H256,
},
DriverError {
reason: String,
},
Cancelled,
Fail,
PostprocessingTimedOut,
}

@marcovc
Copy link
Contributor Author

marcovc commented Jan 16, 2024

Thank you. Closing.

@marcovc marcovc closed this as completed Jan 16, 2024
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

No branches or pull requests

2 participants