-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enable ResolvePayloadFuture to be generic to the PayloadJob trait #5452
Comments
how are you using your type? because, by default, the generator is controlled by the service: reth/crates/payload/builder/src/service.rs Lines 159 to 162 in 460b5f6
which is wired to the engine API |
I am just implementing a custom generator, with a custom job, and spawning a custom payload service, but still using the reth PayloadService from the payload crate. Then I interact with the reth payload service via the payload handle resolve function, which unfortunately can only return a BuiltPayload future. |
gotcha, I need to think about this a bit more because it would introduce a few more changes wrt generics |
Okk, please let me know. If it's not a huge change i d like to take it. |
Hi @mattsse sorry to hassle you, have you got any news on this? Currently I have solved it by duplicating the PayloadService code but I am a bit worried about future conflicts. |
this would require significant changes across the codebase and is more or less blocked by this #5501 perhaps we can at least introduce a new associated type to the trait for now and require that it is But I also think you should be able to work around this for your use case with some extra code bypassing the payload handle, which doesn't have generics |
Thanks a lot Matt. Could you please show me how would you by pass the payload handle? |
Would this be resolved by just making the That or make |
that would def make this possible, yeah let's do that first. then I think we want the return type of the Future Also |
Awesome, I'll PR that for your right away, will drastically simplify my (and I assume others) payload building logic :) |
I left out the |
Thanks @idatsy. This is not going to solve my issue as I am using the payload crate (generator + service + handle) and I like how it is structured. I don't even think that @mattsse I love the idea of restricting the ResolvePayloadFuture to |
This issue is stale because it has been open for 21 days with no activity. |
This issue is stale because it has been open for 21 days with no activity. |
marking this as completed because this is now possible: reth/crates/payload/builder/src/service.rs Line 201 in f23250d
reth/crates/payload/builder/src/traits.rs Lines 27 to 28 in f23250d
|
Describe the feature
I am using the reth Payload crate to modify the default behaviour of engine Api payload jobs. I am implementing the PayloadJobGenerator passing my own PayloadJob.
Currently the
PayloadJob::resolve()
returns aResolvePayloadFuture
which is tied to the BuiltPayload reth type currently consumed by the engine API.I 'd love that the ResolvePayloadFuture could be generic so that I could return a
BuiltPayload
and some other parameter that I am calculating from my PayloadJobs.@mattsse do you have any better way to achieve this?
I'd love to pick this up myself.
Additional context
No response
The text was updated successfully, but these errors were encountered: