Port blob_to_kzg_commitment tests to pytest#4541
Conversation
|
Hey Leo, yeah the proof of concept looks fine. Templates look nice. Just some random feedback:
PS: I merged a fix to the legacy tests which prevented other tests from working. See: |
Will add a decorator that make the test run only in generation mode
ok
ok
Ok, should run only in minimal or only in mainnet?
Ok, will include this |
It will produce the same values for both, but technically it should exist in the |
By making the test run at test time instead of collection time in SSZ generic container. This was first introduced here: #4541 but that PR has more complications with other things
I checked here that kzg_4844.py in master has the same content that here kzg_4844_legacy.py in this branch, so it should be included. |
|
@jtraglia please check again |
| blob = VALID_BLOBS[index] | ||
|
|
||
| @manifest(preset_name="general", suite_name="kzg-mainnet") | ||
| @only_generator("randomized test for broad coverage, not point-to-point CI") |
There was a problem hiding this comment.
Description isn't really accurate or helpful. It's not randomized and what is "point-to-point" CI exactly?
I'd prefer no rational sentence but if it's necessary maybe something like this instead? For both instances of this.
| @only_generator("randomized test for broad coverage, not point-to-point CI") | |
| @only_generator("too slow") |
There was a problem hiding this comment.
@leolara this suggestion applies to multiple lines:
For both instances of this.
| @spec_cache(["blob_to_kzg_commitment"]) | ||
| def the_test(spec): | ||
| commitment = spec.blob_to_kzg_commitment(blob) | ||
| # assert exception is not thrown with valid blob |
There was a problem hiding this comment.
Let's remove the useless comment.
| except Exception: | ||
| pass | ||
|
|
||
| # exception is thrown |
There was a problem hiding this comment.
Let's remove the useless comment.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
It is not useless, it is a justtification to assert False
There was a problem hiding this comment.
I mean to assert commitment is None
tests/infra/spec_cache.py
Outdated
There was a problem hiding this comment.
Please remove the new spec caching stuff. This is irrelevant to this PR & I'm not ready to approve that stuff yet.
There was a problem hiding this comment.
But, you added non-multithreading caching to this?
There was a problem hiding this comment.
You mean like the cached_blob_to_kzg_commitment wrapper function? Sure but that was way simpler. Not looking to start an argument, just stating that I'm not ready to review/merge that part yet. This PR should focus on converting the tests to pytest, not adding new features. Please remove it.
There was a problem hiding this comment.
This PR doesn't need to include any caching. It doesn't matter to me if don't add back the cached_blob_to_kzg_commitment function. That's not really important.
There was a problem hiding this comment.
Sorry, I don't understand.
I am wrong stipulating that this is porting a test that in the orginal was caching spec.blob_to_kzg_commitment with cached_blob_to_kzg_commitment and now it is caching it with @spec_cache(["blob_to_kzg_commitment"])
There was a problem hiding this comment.
Yes, so this PR is making a rather large additional change; it's doing more than just porting some test to pytest. @leolara I don't understand why you're pushing back so hard on this. I'm just asking for you to split the spec_cache part out of this PR. I will not approve this PR until then.
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
5363c1e to
53b3d50
Compare
|
The command |
|
@jtraglia please check again, I used |
blob_to_kzg_commitment tests to pytest

In this PR:
kzg_4844_legacy.pythat is implemented elsewhere).Dramatically reduce the start time of generated tests, but refactoring a test that was being executed always at collection phase.This has been merged now in another PRNote: this PR is based on the new caching system PR, to keep the non-multithread caching that was already implemented in kzg_4844_legacy in the refactored version. #4440