-
Notifications
You must be signed in to change notification settings - Fork 34
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: check blob data availability #879
Changes from all commits
d2282aa
aa0a18f
77f7f6d
0713aaf
06da89a
ca1b094
1e0c3c9
47a1f94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# TODO: maybe allow doing this without declaring a new struct? | ||
defmodule Types.Blobdata do | ||
@moduledoc """ | ||
BlobSidecar data optimized for usage in `on_block`. | ||
This is needed to run the spectests. | ||
""" | ||
@behaviour LambdaEthereumConsensus.Container | ||
|
||
fields = [:blob, :proof] | ||
@enforce_keys fields | ||
defstruct fields | ||
|
||
@type t :: %__MODULE__{blob: Types.blob(), proof: Types.kzg_proof()} | ||
|
||
@impl LambdaEthereumConsensus.Container | ||
def schema do | ||
[ | ||
blob: TypeAliases.blob(), | ||
proof: TypeAliases.kzg_proof() | ||
] | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,22 +62,22 @@ defmodule Mix.Tasks.GenerateSpecTests do | |
module_name = MetaUtils.test_module(config, fork, runner) | ||
runner_module = MetaUtils.runner_module(runner) | ||
|
||
# TODO: we can isolate tests that use the DB from each other by using ExUnit's tmp_dir context option. | ||
header = """ | ||
defmodule #{module_name} do | ||
use ExUnit.Case, async: false | ||
|
||
setup_all do | ||
start_link_supervised!({LambdaEthereumConsensus.Store.Db, dir: "tmp/#{config}_#{fork}_#{runner}_test_db"}) | ||
start_link_supervised!(LambdaEthereumConsensus.Store.Blocks) | ||
start_link_supervised!(LambdaEthereumConsensus.Store.BlockStates) | ||
Application.fetch_env!(:lambda_ethereum_consensus, ChainSpec) | ||
|> Keyword.put(:config, #{chain_spec_config(config)}) | ||
|> then(&Application.put_env(:lambda_ethereum_consensus, ChainSpec, &1)) | ||
end | ||
|
||
setup do | ||
setup %{tmp_dir: tmp_dir} do | ||
on_exit(fn -> LambdaEthereumConsensus.StateTransition.Cache.clear_cache() end) | ||
start_link_supervised!({LambdaEthereumConsensus.Store.Db, dir: tmp_dir}) | ||
start_link_supervised!(LambdaEthereumConsensus.Store.Blocks) | ||
start_link_supervised!(LambdaEthereumConsensus.Store.BlockStates) | ||
:ok | ||
end | ||
""" | ||
|
||
|
@@ -92,6 +92,7 @@ defmodule Mix.Tasks.GenerateSpecTests do | |
|
||
defp generate_case(runner_module, testcase) do | ||
""" | ||
@tag :tmp_dir | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whats this for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! |
||
#{if runner_module.skip?(testcase), do: "\n@tag :skip", else: ""} | ||
test "#{SpecTestCase.name(testcase)}" do | ||
testcase = #{inspect(testcase)} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉