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

Add Network Config Test to Check Against Upstream Values #12864

Open
terencechain opened this issue Sep 7, 2023 · 10 comments · May be fixed by #13024
Open

Add Network Config Test to Check Against Upstream Values #12864

terencechain opened this issue Sep 7, 2023 · 10 comments · May be fixed by #13024
Labels
Good First Issue Good for newcomers Tests

Comments

@terencechain
Copy link
Member

currently, we load beacon chain config from the spec repo to check they comply
We don't load the network config for compliance check, and we should add that

@0xCMars
Copy link

0xCMars commented Sep 8, 2023

Hi, I'd like to pick this up, and I think that prysm uses /tools/specs-checker and bazel command to run the check. And I'm a little confused about what network config we want to check. Which spec is the network config referred to? Should I modify and add the load & check func based on the specs-checker or should I add new tools?

@nisdas nisdas changed the title add network config test to check against up stream values Add Network Config Test to Check Against Upstream Values Sep 8, 2023
@terencechain
Copy link
Member Author

terencechain commented Sep 8, 2023

Hi @0xCMars, the network configs are separated in prysm config 1, but it's defined in the same place in the consensus spec yaml 2. We also skipped them in place holders 3 for load config test

@0xCMars
Copy link

0xCMars commented Sep 11, 2023

Ok, I got it. And I found the TestLoadConfigFile check beacon config(which is defined in mainnet_config.go), and like u said we skipped the network config struct tag in the consensus spec by using a placeholder. And for now, I wonder if I should write a new t.Run in TestLoadConfigFile to check the network config or should I add this func in the exist t.Run? Which method is more in line with our code specifications?
For now, I will load the networkconfig from consensus and unmarshal it and write a func like assertEqualConfigs to compare the value.

@0xCMars
Copy link

0xCMars commented Sep 11, 2023

Hi@terencechain .
When I checked the network config, I found some inconsistencies between our network config and consensus spec. As shown below, MaxChunkSize and GossipMaxSize are defined in mainnetNetworkConfig, which values are respectively 1 << 20 and 1 << 20, but in network config, values are 10 * 1 << 20 and 10 * 1 << 20.

inconsistency

I looked into the code and think that this problem may caused by Ethereum upgrades and change specs, but we are still in the old version and use var Like GossipMaxSize and GossipMaxSizeBellatri to distinguish.

I don't know how to handle this situation. Hope u can give some advice.

@terencechain
Copy link
Member Author

cc @nisdas for the networking spec quesitons

@0xCMars
Copy link

0xCMars commented Sep 26, 2023

@terencechain Hi, Is there any new here? I have gone through part of the prysm code and want to participate in the development, but I found that issues are difficult to start, mainly because most of them are related to network synchronization. So could you give some suggestions and guidance? How to participate in the development of new features? (which I think it will help people better understand the code) Or whether there are part-time or intern like other communities. Thx for your time.

@nisdas
Copy link
Member

nisdas commented Sep 26, 2023

@0xCMars The reason it is different is because the mainnet specs are not distinguishing between pre/post bellatrix gossip message and chunk sizes, while we are. This was removed in ethereum/consensus-specs@5576d0e on the specification's end, so for our case we will also have to remove distingushing it and just use one variable name everywhere with the higher value.

@james-prysm james-prysm mentioned this issue Sep 27, 2023
2 tasks
@0xCMars 0xCMars linked a pull request Oct 10, 2023 that will close this issue
@0xCMars
Copy link

0xCMars commented Oct 10, 2023

Hi, While submitting my new PR, the DeepSource said

"func ReplaceHexStringWithYAMLFormat has a cyclomatic complexity of 28 with "very-high" risk"

the func is in here but I didn't modify any part of that func, Can anyone give me some advice to fix that problem?

@james-prysm
Copy link
Contributor

@0xCMars it just means the switch statement is too long, it's probably ok until we try to break it out or something.

@0xCMars
Copy link

0xCMars commented Oct 12, 2023

@james-prysm Yes, I have tried to fix it in my last PR commit. Thanks for your help, and I want to ask that my PR was waiting for the GitHub workflow to get some expected result, but it just stuck there, and no result was returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good for newcomers Tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants