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

1.1.5 merge spec tests #2781

Merged
merged 12 commits into from
Nov 10, 2021
Merged

Conversation

realbigsean
Copy link
Member

@realbigsean realbigsean commented Nov 4, 2021

Issue Addressed

1.1.5 spec tests

Proposed Changes

Additional Info

  • Does not include ssz static fixes
  • Does not include any fork choice related changes

@realbigsean realbigsean added kintsugi 🍵 ready-for-review The code is ready for review labels Nov 4, 2021
@realbigsean realbigsean mentioned this pull request Nov 4, 2021
@realbigsean realbigsean changed the title 1.1.4 merge specs 1.1.4 merge spec tests Nov 4, 2021
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.

Awesome work! I made one subjective suggestion, lmk what you think.

I also had a go at removing the Transaction new-type, which is possible because the enum was removed. Code is here paulhauner@63b01d5. Let me know what you think, it's nice to avoid the ssz/tree_hash manual impls.

@realbigsean
Copy link
Member Author

I also had a go at removing the Transaction new-type, which is possible because the enum was removed. Code is here paulhauner/lighthouse@63b01d5. Let me know what you think, it's nice to avoid the ssz/tree_hash manual impls.

I did attempt to go this route after finishing the implementation in the PR. But I got hung up on generics in the Serialize/Deserialize implementations so gave up. My issue might have been that I was attempting to type Transaction on EthSpec instead of the var list length -> type Transaction<T> = VariableList<u8, T::MaxBytesPerTransaction>.

Anyways, I think this is much better! Was also wondering if adding #[ssz(transparent)] might be worth doing in the future? Was thinking of it as another route around the manual impls for a new-type.

@realbigsean realbigsean added work-in-progress PR is a work-in-progress and removed ready-for-review The code is ready for review labels Nov 5, 2021
@paulhauner
Copy link
Member

paulhauner commented Nov 5, 2021

Anyways, I think this is much better! Was also wondering if adding #[ssz(transparent)] might be worth doing in the future?

Yeah, I think that would be great. That would have been a nice solution here, but involves some dank macro work that I didn't have an appetite for.

@realbigsean realbigsean changed the title 1.1.4 merge spec tests 1.1.5 merge spec tests Nov 9, 2021
@realbigsean realbigsean added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Nov 9, 2021
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.

Very nice! Only a few very minor changes. Feel free to squash-merge after you've addressed them!

.gas_limit
.safe_add(parent.gas_limit.safe_div(T::gas_limit_denominator())?)?
{
return Err(BlockProcessingError::ExecutionInvalidGasLimitIncrease {
Copy link
Member

Choose a reason for hiding this comment

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

We can remove these ExecutionInvalidGas* error variants, too.

.latest_execution_payload_header()?
.block_number
.safe_add(1)?,
BlockProcessingError::ExecutionBlockNumberIncontiguous {
Copy link
Member

Choose a reason for hiding this comment

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

We can also remove this error variant.

that the broad Ethereum community has elected to override the terminal PoW block. \
Incorrect use of this flag will cause your node to experience a consensus
failure. Be extremely careful with this flag.")
.takes_value(true)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should make a "requires" dependency between both "terminal-block-hash-override" and "terminal-block-hash-epoch-override" (i.e. you can't supply one without the other).

I can't see how they'd be effective without each other and it would be nice to fail early.

// Gas used is less than the gas limit
if execution_payload.gas_used > execution_payload.gas_limit {
return Err(BlockError::ExecutionPayloadError(
ExecutionPayloadError::GasUsedExceedsLimit,
Copy link
Member

Choose a reason for hiding this comment

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

We can remove this GasUsedExceedsLimit error variant.

// The execution payload block hash is not equal to the parent hash
if execution_payload.block_hash == execution_payload.parent_hash {
return Err(BlockError::ExecutionPayloadError(
ExecutionPayloadError::BlockHashEqualsParentHash,
Copy link
Member

Choose a reason for hiding this comment

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

We can remove this BlockHashEqualsParentHash error variant.

@paulhauner paulhauner added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Nov 10, 2021
@paulhauner
Copy link
Member

It looks like there's a consistent stack overflow on Windows 🤔

 test engine_api::http::test::execute_payload_request ... ok
test engine_api::http::test::consensus_validated_request ... ok
test engine_api::http::test::forkchoice_updated_request ... ok
test engine_api::http::test::get_block_by_hash_request ... ok
test engine_api::http::test::get_block_by_number_request ... ok
test engine_api::http::test::get_payload_request ... ok
test engine_api::http::test::prepare_payload_request ... ok
test engine_api::http::test::geth_test_vectors ... ok
test test::finds_valid_terminal_block_hash ... ok
test test::produce_three_valid_pos_execution_blocks ... ok
test test::rejects_invalid_terminal_block_hash ... ok
test test::rejects_unknown_terminal_block_hash ... ok
test test::verifies_valid_terminal_block_hash ... ok
test test_utils::execution_block_generator::test::pow_chain_only ... ok
memory allocation of 2147483650 bytes failed
error: test failed, to rerun pass '-p execution_layer --lib'

Caused by:
  process didn't exit successfully: `D:\a\lighthouse\lighthouse\target\release\deps\execution_layer-c989491669370dbf.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
make: *** [Makefile:88: test-release] Error -1073740791

I'm in the middle of some things, but I'll try have a look. I assume it's due to recursion somewhere.

@paulhauner
Copy link
Member

It looks like there's a consistent stack overflow on Windows thinking

Feel free to just leave this, we can pick it up in another PR.

- Require both "terminal-block-hash-epoch-override" and "terminal-block-hash-override" when either flag is used
@realbigsean realbigsean merged commit efe0947 into sigp:kintsugi Nov 10, 2021
paulhauner added a commit that referenced this pull request Nov 11, 2021
* Fix arbitrary check kintsugi

* Add merge chain spec fields, and a function to determine which constant to use based on the state variant

* increment spec test version

* Remove `Transaction` enum wrapper

* Remove Transaction new-type

* Remove gas validations

* Add `--terminal-block-hash-epoch-override` flag

* Increment spec tests version to 1.1.5

* Remove extraneous gossip verification ethereum/consensus-specs#2687

* - Remove unused Error variants
- Require both "terminal-block-hash-epoch-override" and "terminal-block-hash-override" when either flag is used

* - Remove a couple more unused Error variants

Co-authored-by: Paul Hauner <paul@paulhauner.com>
paulhauner added a commit that referenced this pull request Nov 28, 2021
* Fix arbitrary check kintsugi

* Add merge chain spec fields, and a function to determine which constant to use based on the state variant

* increment spec test version

* Remove `Transaction` enum wrapper

* Remove Transaction new-type

* Remove gas validations

* Add `--terminal-block-hash-epoch-override` flag

* Increment spec tests version to 1.1.5

* Remove extraneous gossip verification ethereum/consensus-specs#2687

* - Remove unused Error variants
- Require both "terminal-block-hash-epoch-override" and "terminal-block-hash-override" when either flag is used

* - Remove a couple more unused Error variants

Co-authored-by: Paul Hauner <paul@paulhauner.com>
paulhauner added a commit that referenced this pull request Nov 28, 2021
* Fix arbitrary check kintsugi

* Add merge chain spec fields, and a function to determine which constant to use based on the state variant

* increment spec test version

* Remove `Transaction` enum wrapper

* Remove Transaction new-type

* Remove gas validations

* Add `--terminal-block-hash-epoch-override` flag

* Increment spec tests version to 1.1.5

* Remove extraneous gossip verification ethereum/consensus-specs#2687

* - Remove unused Error variants
- Require both "terminal-block-hash-epoch-override" and "terminal-block-hash-override" when either flag is used

* - Remove a couple more unused Error variants

Co-authored-by: Paul Hauner <paul@paulhauner.com>
paulhauner added a commit that referenced this pull request Dec 2, 2021
* Fix arbitrary check kintsugi

* Add merge chain spec fields, and a function to determine which constant to use based on the state variant

* increment spec test version

* Remove `Transaction` enum wrapper

* Remove Transaction new-type

* Remove gas validations

* Add `--terminal-block-hash-epoch-override` flag

* Increment spec tests version to 1.1.5

* Remove extraneous gossip verification ethereum/consensus-specs#2687

* - Remove unused Error variants
- Require both "terminal-block-hash-epoch-override" and "terminal-block-hash-override" when either flag is used

* - Remove a couple more unused Error variants

Co-authored-by: Paul Hauner <paul@paulhauner.com>
@realbigsean realbigsean deleted the 1.1.4-merge-specs branch November 21, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kintsugi 🍵 waiting-on-author The reviewer has suggested changes and awaits thier implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants