Skip to content

Conversation

@guha-rahul
Copy link
Contributor

@guha-rahul guha-rahul commented May 2, 2024

re: #8674

Fixes: #7929
The error i am facing -

error: failed to load manifest for workspace member `/home/rahul/reth/bin/reth`

Caused by:
  failed to load manifest for dependency `reth-basic-payload-builder`

Caused by:
  failed to load manifest for dependency `reth-engine-primitives`

Caused by:
  failed to load manifest for dependency `reth-chainspec`

Caused by:
  failed to load manifest for dependency `reth-primitives`

Caused by:
  failed to parse manifest at `/home/rahul/reth/crates/primitives/Cargo.toml`

Caused by:
  error inheriting `reth_chainspec` from workspace root manifest's `workspace.dependencies.reth_chainspec`

Caused by:
  `dependency.reth_chainspec` was not found in `workspace.dependencies`

Even tho i have reth-chainspec = { path = "crates/storage/chainspec" } under [workspace.dependencies] .

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice, a few nits and suggestions

license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "Commonly used types in reth."
Copy link
Collaborator

Choose a reason for hiding this comment

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

needs update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are some extra imports, will remove them when i get back electricity.

Copy link
Collaborator

Choose a reason for hiding this comment

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

needs regular lib.rs header, see other crates for ref

revm.workspace = true
revm-primitives = { workspace = true, features = ["serde"] }

reth_chainspec.workspace = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this is your error

Suggested change
reth_chainspec.workspace = true
reth-chainspec.workspace = true

Copy link
Contributor Author

@guha-rahul guha-rahul May 2, 2024

Choose a reason for hiding this comment

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

Got a cycle dependency error:-

error: cyclic package dependency: package `reth-chainspec v0.2.0-beta.6 (/home/rahul/reth/crates/chainspec)` depends on itself. Cycle:
package `reth-chainspec v0.2.0-beta.6 (/home/rahul/reth/crates/chainspec)`
    ... which satisfies path dependency `reth-chainspec` (locked to 0.2.0-beta.6) of package `reth-primitives v0.2.0-beta.6 (/home/rahul/reth/crates/primitives)`
    ... which satisfies path dependency `reth-primitives` (locked to 0.2.0-beta.6) of package `reth-chainspec v0.2.0-beta.6 (/home/rahul/reth/crates/chainspec)`
    ... which satisfies path dependency `reth-chainspec` (locked to 0.2.0-beta.6) of package `reth-engine-primitives v0.2.0-beta.6 (/home/rahul/reth/crates/engine-primitives)`
    ... which satisfies path dependency `reth-engine-primitives` (locked to 0.2.0-beta.6) of package `reth-basic-payload-builder v0.2.0-beta.6 (/home/rahul/reth/crates/payload/basic)`
    ... which satisfies path dependency `reth-basic-payload-builder` (locked to 0.2.0-beta.6) of package `reth v0.2.0-beta.6 (/home/rahul/reth/bin/reth)`
    ... which satisfies path dependency `reth` (locked to 0.2.0-beta.6) of package `beacon-api-sse v0.0.0 (/home/rahul/reth/examples/beacon-api-sse)`

Should removing reth-chainspec from crates/primitives solve it?

@mattsse mattsse added the C-debt A clean up/refactor of existing code label May 2, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

we also need to delete chainspec from primitives crate

@guha-rahul
Copy link
Contributor Author

hey @mattsse , just a quick clarification , when i am removing reth-chainspec from primitives, there are some functions that are imported to other crates, eg: revm_spec_by_timestamp_after_merge, so for those we have to explicitly pass the 'reth-primitives' or there is something i am missing?

@mattsse
Copy link
Collaborator

mattsse commented May 3, 2024

these functions we should also move

@guha-rahul
Copy link
Contributor Author

these functions we should also move
I have identified 5 functions in the reth-primitives crate that are being used in other crates and they have chainspec in params.
eg: revm_spec_by_timestamp_after_merge is defined in primitive crate and i am having a mismatch type in reth-engine-primitives crate.
Can you please elaborate more on how we should move the functions?

@mattsse
Copy link
Collaborator

mattsse commented May 3, 2024

all chainspec usage needs to be removed from reth-primitives

if these are functions then we can move them to the new crate

@guha-rahul guha-rahul requested a review from mattsse May 4, 2024 04:28
@guha-rahul
Copy link
Contributor Author

guha-rahul commented May 4, 2024

hey @mattsse , any feedback on the above commits?

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

hmm, need to take a closer look at all the deps, but in essence this is exactly what we want

@mattsse mattsse self-assigned this May 4, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

okay, I made some progress here on figuring out how things should be structured.

what we need to do is keep a dependency on reth-primitives in the chainspec crate, so chainspec depends on reth-primitives

this should do it

@guha-rahul
Copy link
Contributor Author

Regarding the failed tests, i am struggling to understand why i am getting errors in crates/net/eth-wire-types/src/receipt.rs

@Rjected
Copy link
Member

Rjected commented May 24, 2024

just updated Cargo.lock which was preventing some tests from running

Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

could you remove the old chainspec now that it's in a separate crate, along with everything else that was copied to this new crate? we don't want to keep any duplicate files around

@mattsse
Copy link
Collaborator

mattsse commented May 25, 2024

I also want merge this after we have merged all changes in #8214

@guha-rahul
Copy link
Contributor Author

could you remove the old chainspec now that it's in a separate crate, along with everything else that was copied to this new crate? we don't want to keep any duplicate files around

hey when I am trying to import the new chainspec in place of the old one , I am getting cyclic dependency errors and @mattsse previously mentioned we cannot import chainspec in reth-primitives since it will cause a cyclic dependency error.

@joshieDo joshieDo requested a review from DaniPopes as a code owner June 17, 2024 12:58
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

@joshieDo joshieDo enabled auto-merge June 17, 2024 13:21
@joshieDo joshieDo requested a review from Rjected June 17, 2024 13:21
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

lgtm

@joshieDo joshieDo added this pull request to the merge queue Jun 17, 2024
@joshieDo
Copy link
Collaborator

thank you @guha-rahul!

Merged via the queue into paradigmxyz:main with commit 15cca65 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-debt A clean up/refactor of existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extract Chainspec type from primitives

4 participants