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

[Merged by Bors] - Initial work to remove engines fallback from the execution_layer crate #3257

Closed

Conversation

divagant-martian
Copy link
Collaborator

@divagant-martian divagant-martian commented Jun 9, 2022

Issue Addressed

Part of #3118

Proposed Changes

Use only the first url given in the execution engine, if more than one is provided log it.
This change only moves having multiple engines to one. The amount of code cleanup that can and should be done forward is not small and would interfere with ongoing PRs. I'm keeping the changes intentionally very very minimal.

Additional Info

Future works:

In general I think those changes can be done incrementally and in individual pull requests.

}
}
Err(e) => {
let i = 0usize;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This looks horrible, but I don't want to touch the EngineError::Api (which contains the id) to keep the changes minimal

@divagant-martian divagant-martian changed the title [WIP] Remove engines fallback from the execution_layer crate [WIP] Initial work to remove engines fallback from the execution_layer crate Jun 9, 2022
@divagant-martian divagant-martian marked this pull request as ready for review June 9, 2022 23:16
@divagant-martian divagant-martian changed the title [WIP] Initial work to remove engines fallback from the execution_layer crate Initial work to remove engines fallback from the execution_layer crate Jun 9, 2022
Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

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

LGTM. I thought the EngineErrors doesn't need to be a vec anymore but we can change that after we switch to a single builder as you mentioned

Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Looks good, I only have a couple of really minor suggestions.

We'll have to come back and clean this up, but I appreciate that this will unblocks #3094 and I think this PR is a good way to do that :)

beacon_node/execution_layer/src/engines.rs Outdated Show resolved Hide resolved
beacon_node/execution_layer/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

LGTM! Feel free to bors at will :)

@divagant-martian
Copy link
Collaborator Author

bors r+

bors bot pushed a commit that referenced this pull request Jun 22, 2022
…ate (#3257)

## Issue Addressed

Part of #3160 

## Proposed Changes
Use only the first url given in the execution engine, if more than one is provided log it.
This change only moves having multiple engines to one. The amount of code cleanup that can and should be done forward is not small and would interfere with ongoing PRs. I'm keeping the changes intentionally very very minimal.

## Additional Info

Future works:
- In [ `EngineError` ](https://github.com/sigp/lighthouse/blob/9c429d0764ed91cf56efb8a47a35a556b54a86a4/beacon_node/execution_layer/src/engines.rs#L173-L177) the id is not needed since it now has no meaning.
- the [ `first_success_without_retry` ](https://github.com/sigp/lighthouse/blob/9c429d0764ed91cf56efb8a47a35a556b54a86a4/beacon_node/execution_layer/src/engines.rs#L348-L351) function can return a single error.
- the [`first_success`](https://github.com/sigp/lighthouse/blob/9c429d0764ed91cf56efb8a47a35a556b54a86a4/beacon_node/execution_layer/src/engines.rs#L324) function can return a single error.
- After the redundancy is removed for the builders, we can probably make the [ `EngineErrors` ](https://github.com/sigp/lighthouse/blob/9c429d0764ed91cf56efb8a47a35a556b54a86a4/beacon_node/execution_layer/src/lib.rs#L69) carry a single error.
- Merge the [`Engines`](https://github.com/sigp/lighthouse/blob/9c429d0764ed91cf56efb8a47a35a556b54a86a4/beacon_node/execution_layer/src/engines.rs#L161-L165) struct and [`Engine` ](https://github.com/sigp/lighthouse/blob/9c429d0764ed91cf56efb8a47a35a556b54a86a4/beacon_node/execution_layer/src/engines.rs#L62-L67)
- Fix the associated configurations and cli params. Not sure if both are done in #3214

In general I think those changes can be done incrementally and in individual pull requests.
@bors bors bot changed the title Initial work to remove engines fallback from the execution_layer crate [Merged by Bors] - Initial work to remove engines fallback from the execution_layer crate Jun 22, 2022
@bors bors bot closed this Jun 22, 2022
@divagant-martian divagant-martian deleted the remove-engines-fallback branch June 22, 2022 16:29
bors bot pushed a commit that referenced this pull request Jul 4, 2022
bors bot pushed a commit that referenced this pull request Jul 11, 2022
bors bot pushed a commit that referenced this pull request Jul 13, 2022
## Issue Addressed

Resolves #3176

## Proposed Changes

Continues from PRs by @divagant-martian to gradually remove EL redundancy (see #3284, #3257).

This PR achieves:

- Removes the `broadcast` and `first_success` methods. The functional impact is that every request to the EE will always be tried immediately, regardless of the cached `EngineState` (this resolves #3176). Previously we would check the engine state before issuing requests, this doesn't make sense in a single-EE world; there's only one EE so we might as well try it for every request.
- Runs the upcheck/watchdog routine once per slot rather than thrice. When we had multiple EEs frequent polling was useful to try and detect when the primary EE had come back online and we could switch to it. That's not as relevant now.
- Always creates logs in the `Engines::upcheck` function. Previously we would mute some logs since they could get really noisy when one EE was down but others were functioning fine. Now we only have one EE and are upcheck-ing it less, it makes sense to always produce logs.

This PR purposefully does not achieve:

- Updating all occurances of "engines" to "engine". I'm trying to keep the diff small and manageable. We can come back for this.

## Additional Info

NA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants