forest icon indicating copy to clipboard operation
forest copied to clipboard

Cleanup build version module

Open elmattic opened this issue 2 years ago • 8 comments

Summary of changes Changes introduced in this pull request:

  • [x] Remove forest/build.rs
  • [x] Remove hardcoded user_version and use forest version
  • [x] Remove api version numbers and use forest version
  • [x] Remove BuiltType
  • [x] Remove NodeType

Reference issue to close (if applicable)

Closes #1647

Other information and links

elmattic avatar Jul 28 '22 16:07 elmattic

@lemmih Is this PR ok for merging? What's left to be done?

elmattic avatar Aug 09 '22 13:08 elmattic

@lemmih Is this PR ok for merging? What's left to be done?

I'm still unsure what the version numbers mean. You said they came from Lotus but why do we want Lotus' version numbers?

lemmih avatar Aug 09 '22 13:08 lemmih

@lemmih Is this PR ok for merging? What's left to be done?

I'm still unsure what the version numbers mean. You said they came from Lotus but why do we want Lotus' version numbers?

As far as I understand those are the RPC api version numbers. We have version 1.1.0, and 1.5.0/ 2.3.0 for Lotus (so different numbers). I think this is arbitrary choice, it's just like regular semver.

elmattic avatar Aug 09 '22 13:08 elmattic

@lemmih Is this PR ok for merging? What's left to be done?

I'm still unsure what the version numbers mean. You said they came from Lotus but why do we want Lotus' version numbers?

The version that I said came from Lotus was 0.10.2. const BUILD_VERSION: &str = "0.10.2";

This one was indeed removed.

elmattic avatar Aug 09 '22 13:08 elmattic

I'm still quite confused:

  • Why is the forest version string computed in the fil_types package rather than in forest?
  • Why do we need a build script? It looks like the build script doesn't actually do anything (other than renaming a few env variables).
  • Why do we define our own Version data structure?
  • Can't we get rid of NodeType and RUNNING_NODE_TYPE?

lemmih avatar Aug 10 '22 08:08 lemmih

I'm still quite confused:

  • Why is the forest version string computed in the fil_types package rather than in forest?

No reason anymore. Will change this.

  • Why do we need a build script? It looks like the build script doesn't actually do anything (other than renaming a few env variables).

Unfortunately a const binding can't be used because of the format! is not const fn.

  • Why do we define our own Version data structure?

Because we copied this from Lotus codebase. The rpc call wants an u32 and this is a helper struct.

  • Can't we get rid of NodeType and RUNNING_NODE_TYPE?

Yes.

elmattic avatar Aug 10 '22 08:08 elmattic

I'm still quite confused:

  • Why do we need a build script? It looks like the build script doesn't actually do anything (other than renaming a few env variables).

Unfortunately a const binding can't be used because of the format! is not const fn.

Do we need the version string to be const? If it's just about performance, I'm fine with one extra call to format!.

lemmih avatar Aug 10 '22 08:08 lemmih

You can also delete ints, PartialEq, and Display for Version, I think.

lemmih avatar Aug 10 '22 13:08 lemmih