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

feat!: extract BatchReturn to batch package, add methods & tests #286

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jul 3, 2024

I started off by wanting methods on BatchReturn to roughly match what's available in Rust, then I remembered that I was going to add serialization tests for this too because it's in the NI-PoRep path, then I realised that this struct is used in multiple actors and hasn't changed form since it was introduced. In builtin-actors it's in the shared "fil_actors_runtime" package for this very reason. So this PR introduces the same thing here:

  • Extract BatchReturn and FailCode into a new "batch" package
  • Remove all copies, through all actor versions
  • Add methods to BatchReturn: Size(), AllOk(), Codes() []exitcode.ExitCode, CodeAt(n uint64) exitcode.ExitCode
  • Add tests for new methods
  • Add tests for serializations

This is a breaking change because it removes types that were previously there. There are no current direct uses of this type within Lotus today (I'm in the process of introducing one though). This would be a good candidate to ship in a v0.14.0 final I think.

@BigLep
Copy link
Member

BigLep commented Jul 3, 2024

This would be a good candidate to ship in a v0.14.0 final I think.

For now, I added a note to filecoin-project/lotus#12109 as this being an item for the "Mainnet Upgrade Release"

@BigLep
Copy link
Member

BigLep commented Jul 11, 2024

2024-07-11 maintainer conversation: this will get merged after the nv24 nv23 release.

Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

I had no idea how bad this had gotten. Thanks for cleaning up

batch/batch_return.go Show resolved Hide resolved
batch/batch_return.go Show resolved Hide resolved
batch/batch_return.go Show resolved Hide resolved
@ribasushi
Copy link
Contributor

@rvagg @ZenGround0 what's the state of this one?

@rvagg
Copy link
Member Author

rvagg commented Sep 5, 2024

after the nv24 nv23 release

I just need to get back to this and get it landed in the next major release .. so 🔜

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 49.05660% with 81 lines in your changes missing coverage. Please review.

Project coverage is 3.53%. Comparing base (9fa04b1) to head (494117a).

Files with missing lines Patch % Lines
batch/cbor_gen.go 37.03% 40 Missing and 28 partials ⚠️
batch/gen/gen.go 0.00% 6 Missing ⚠️
builtin/v10/verifreg/cbor_gen.go 0.00% 1 Missing ⚠️
builtin/v11/verifreg/cbor_gen.go 0.00% 1 Missing ⚠️
builtin/v12/verifreg/cbor_gen.go 0.00% 1 Missing ⚠️
builtin/v13/verifreg/cbor_gen.go 0.00% 1 Missing ⚠️
builtin/v14/verifreg/cbor_gen.go 0.00% 1 Missing ⚠️
builtin/v15/verifreg/cbor_gen.go 0.00% 1 Missing ⚠️
builtin/v9/verifreg/cbor_gen.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #286      +/-   ##
==========================================
+ Coverage    3.42%    3.53%   +0.10%     
==========================================
  Files         589      592       +3     
  Lines      112037   110759    -1278     
==========================================
+ Hits         3837     3915      +78     
+ Misses     106695   105311    -1384     
- Partials     1505     1533      +28     
Files with missing lines Coverage Δ
batch/batch_return.go 100.00% <100.00%> (ø)
builtin/v10/gen/gen.go 0.00% <ø> (ø)
builtin/v10/verifreg/verifreg_types.go 0.00% <ø> (ø)
builtin/v11/gen/gen.go 0.00% <ø> (ø)
builtin/v11/verifreg/verifreg_types.go 0.00% <ø> (ø)
builtin/v12/gen/gen.go 0.00% <ø> (ø)
builtin/v12/verifreg/verifreg_types.go 0.00% <ø> (ø)
builtin/v13/gen/gen.go 0.00% <ø> (ø)
builtin/v13/market/cbor_gen.go 0.00% <ø> (ø)
builtin/v13/miner/cbor_gen.go 0.80% <ø> (+0.01%) ⬆️
... and 23 more

@rvagg rvagg merged commit aff1b8d into master Sep 6, 2024
8 checks passed
@rvagg rvagg deleted the rvagg/batch-return branch September 6, 2024 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants