-
Notifications
You must be signed in to change notification settings - Fork 41
feat: assertoor implementation support #1324
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
Merged
Changes from 37 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
a2fb27f
Initial assertoor test
rodrigo-o 7382a6c
Added the assertoor task to the CI
rodrigo-o 96fe806
added branch to the ethereum package url
rodrigo-o dbab954
removed jobs from CI and put them in their own file
rodrigo-o 87ced43
test without our fork
rodrigo-o 32f783e
add our eth pkg fork again
rodrigo-o b21ca2d
check now that branch is correctly picked up
rodrigo-o cce3bbd
Change file path to config
rodrigo-o 5449526
changing config file to the root of the project
rodrigo-o 89abeb6
Change in the ethereum-package branch
rodrigo-o 0be4b29
Testing with the participant config
rodrigo-o 7414d9b
Making the file more near to network_params for testing
rodrigo-o df8d22d
Added syncing and peers endpoint to valdiate assertoor execution
rodrigo-o a18768f
Push consensus file to take it form the repo
rodrigo-o dd3c1bb
Some fixes and logging
rodrigo-o 0ad9cd5
Added an initial implementation of the config/spec
rodrigo-o 147200e
cleanup and removed diffs
rodrigo-o e3d47ab
Merge branch 'main' into initial-assertoor-implementation
rodrigo-o 13a5bc1
format
rodrigo-o 85aa3f6
Merge branch 'sentry-alert-on-head-not-updated' into initial-assertoo…
rodrigo-o 192ac92
Moved sync_status to Libp2p and made sync blocks depend on the store
rodrigo-o 558933f
Merge branch 'main' into initial-assertoor-implementation
rodrigo-o f45a91b
Added some additional info to libp2p status and removed unneded alias
rodrigo-o 292aed8
initial headers/head implementation
rodrigo-o e7937cc
Small change to the log_requests plug and removal of old loggers
rodrigo-o 6919410
fixed /states/{state_id}/finality_checkpoints for genesis executions
rodrigo-o b370534
Merge branch 'main' into initial-assertoor-implementation
rodrigo-o 88852c4
Fixed epoch being a number instead of a string in finality checkpoint…
rodrigo-o 0c68375
Assertoor check for testing
rodrigo-o cbdb4a6
Network params modification for testing assertoor correctly
rodrigo-o d776412
Merge branch 'main' into initial-assertoor-implementation
rodrigo-o 52065b0
fix a test and format
rodrigo-o 5ef4e25
Remove unneded assertoor files and depend on assertoor-structure-setu…
rodrigo-o 82674e0
Fix the extenxion of the network params in the assertoor config
rodrigo-o a8f290c
fixed assertoor config filepath
rodrigo-o 195f349
Merge branch 'main' into initial-assertoor-implementation
rodrigo-o 349917a
point to the main cl-stability-check
rodrigo-o 573795c
fixed a typo
rodrigo-o a0b1612
rephrase an error
rodrigo-o 0520076
Correctyle configure assertoor in the ci
rodrigo-o 0c86386
Update beacon_controller.ex
rodrigo-o File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| defmodule BeaconApi.V1.ConfigController do | ||
| use BeaconApi, :controller | ||
| require Logger | ||
|
|
||
| alias BeaconApi.ApiSpec | ||
| alias BeaconApi.Utils | ||
|
|
||
| plug(OpenApiSpex.Plug.CastAndValidate, json_render_error_v2: true) | ||
|
|
||
| @chain_spec_removed_keys [ | ||
| "ATTESTATION_SUBNET_COUNT", | ||
| "KZG_COMMITMENT_INCLUSION_PROOF_DEPTH", | ||
| "UPDATE_TIMEOUT" | ||
| ] | ||
| @chain_spec_renamed_keys [ | ||
| {"MAXIMUM_GOSSIP_CLOCK_DISPARITY", "MAXIMUM_GOSSIP_CLOCK_DISPARITY_MILLIS"} | ||
| ] | ||
| @chain_spec_hex_fields [ | ||
| "TERMINAL_BLOCK_HASH", | ||
| "GENESIS_FORK_VERSION", | ||
| "ALTAIR_FORK_VERSION", | ||
| "BELLATRIX_FORK_VERSION", | ||
| "CAPELLA_FORK_VERSION", | ||
| "DENEB_FORK_VERSION", | ||
| "ELECTRA_FORK_VERSION", | ||
| "DEPOSIT_CONTRACT_ADDRESS", | ||
| "MESSAGE_DOMAIN_INVALID_SNAPPY", | ||
| "MESSAGE_DOMAIN_VALID_SNAPPY" | ||
| ] | ||
|
|
||
| # NOTE: this function is required by OpenApiSpex, and should return the information | ||
| # of each specific endpoint. We just return the specific entry from the parsed spec. | ||
| def open_api_operation(:get_spec), | ||
| do: ApiSpec.spec().paths["/eth/v1/config/spec"].get | ||
|
|
||
| # TODO: This is still an incomplete implementation, it should return some constants | ||
| # along with the chain spec. It's enough for assertoor. | ||
| @spec get_spec(Plug.Conn.t(), any) :: Plug.Conn.t() | ||
| def get_spec(conn, _params), do: json(conn, %{"data" => chain_spec()}) | ||
|
|
||
| defp chain_spec() do | ||
| ChainSpec.get_all() | ||
| |> Map.drop(@chain_spec_removed_keys) | ||
| |> rename_keys(@chain_spec_renamed_keys) | ||
| |> Map.new(fn | ||
| {k, v} when is_integer(v) -> {k, Integer.to_string(v)} | ||
| {k, v} when k in @chain_spec_hex_fields -> {k, Utils.hex_encode(v)} | ||
| {k, v} -> {k, v} | ||
| end) | ||
| end | ||
|
|
||
| defp rename_keys(config, renamed_keys) do | ||
| renamed_keys | ||
| |> Enum.reduce(config, fn {old_key, new_key}, config -> | ||
| case Map.get(config, old_key) do | ||
| nil -> config | ||
| value -> Map.put_new(config, new_key, value) |> Map.delete(old_key) | ||
| end | ||
| end) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.