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

#10036 Replace codename Merge with Bellatrix (1st step) #10044

Conversation

leolara
Copy link
Contributor

@leolara leolara commented Dec 27, 2021

What type of PR is this?

Refactoring

What does this PR do? Why is it needed?

Replace codename Merge with Bellatrix

Which issues(s) does this PR fix?

Fixes #10036

Other notes for review

It does not complete 100% the task #10036 another PR will be necessary

@leolara leolara requested a review from a team as a code owner December 27, 2021 09:08
@CLAassistant
Copy link

CLAassistant commented Dec 27, 2021

CLA assistant check
All committers have signed the CLA.

@leolara
Copy link
Contributor Author

leolara commented Dec 27, 2021

It is not passing in my local system the test TestEndToEnd_MinimalConfig_ValidatorAtCurrentRelease/chain_started but it does not pass it also without any changes, so I guess I have a local problem, and this is not breaking any tests.

The tests I am running is bazel test //testing/endtoend:go_default_test I am not sure if I need to run other tests.

rkapka
rkapka previously requested changes Dec 27, 2021
beacon-chain/state/stateutil/state_hasher.go Outdated Show resolved Hide resolved
beacon-chain/state/stateutil/state_hasher.go Outdated Show resolved Hide resolved
@rkapka
Copy link
Contributor

rkapka commented Dec 27, 2021

Following files need to be properly formatted:
config/params/mainnet_config.go
proto/prysm/v1alpha1/beacon_state.pb.go

@rkapka
Copy link
Contributor

rkapka commented Jan 3, 2022

Hey @leolara , you still need to run gofmt on a few files:

Following files need to be properly formatted:
config/params/mainnet_config.go
proto/prysm/v1alpha1/beacon_state.pb.go
runtime/version/fork.go

@leolara
Copy link
Contributor Author

leolara commented Jan 4, 2022

@rkapka thank you for reminding me that. This PR is marked as WIP. The merge of develop into has caused me so git problems with a commit I did at the same time

@leolara leolara force-pushed the refactor/I10036/rename-merge-to-bellatrix branch from 406f57d to d55d1c5 Compare January 4, 2022 08:09
@leolara
Copy link
Contributor Author

leolara commented Jan 4, 2022

There are lots of things to rename, I will let you know when I think I am finished, so we can review @rkapka . I will try to also rebase on develop after that so it is fresher.

Is there a bazel way of running gofmt? Or I just run it normally?

@potuz
Copy link
Contributor

potuz commented Jan 4, 2022

There are lots of things to rename, I will let you know when I think I am finished, so we can review @rkapka . I will try to also rebase on develop after that so it is fresher.

Is there a bazel way of running gofmt? Or I just run it normally?

You can run it normally or even as a pre commit hook. I recommend you mark the PR as draft, since then reviewers will get an automated email when you mark it requesting a review

@rkapka rkapka dismissed their stale review January 4, 2022 16:11

PR is WIP

@leolara leolara marked this pull request as draft January 5, 2022 00:40
@leolara
Copy link
Contributor Author

leolara commented Jan 5, 2022

@potuz

There are lots of things to rename, I will let you know when I think I am finished, so we can review @rkapka . I will try to also rebase on develop after that so it is fresher.
Is there a bazel way of running gofmt? Or I just run it normally?

You can run it normally or even as a pre commit hook. I recommend you mark the PR as draft, since then reviewers will get an automated email when you mark it requesting a review

Thanks, I changed it to draft

@leolara
Copy link
Contributor Author

leolara commented Jan 5, 2022

I want to note that there is more than a thousand "merge" string instances in the code, and that some times it actually means the action of merge, as opposed to the hard-fork. So I have to read it 🤣

@terencechain
Copy link
Member

I want to note that there is more than a thousand "merge" string instances in the code, and that some times it actually means the action of merge, as opposed to the hard-fork. So I have to read it 🤣

If it makes it easier, you don't have to replace everything at once. Open a PR package by package is perfectly fine

@@ -12,7 +12,7 @@ import (
"github.com/prysmaticlabs/prysm/testing/util"
)

func Test_MergeComplete(t *testing.T) {
func Test_BellatrixComplete(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

This refers to the action of merge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @terencechain , this one slipped :-)

@leolara
Copy link
Contributor Author

leolara commented Jan 5, 2022

I want to note that there is more than a thousand "merge" string instances in the code, and that some times it actually means the action of merge, as opposed to the hard-fork. So I have to read it 🤣

If it makes it easier, you don't have to replace everything at once. Open a PR package by package is perfectly fine

I am doing it more subject by subject, like I am now changing comments and will send that as a commit. If you think the PR is going to get too long to review, then I could do it in several PRs. I think I am kind of half way

@leolara leolara force-pushed the refactor/I10036/rename-merge-to-bellatrix branch from 69a793a to 30ff158 Compare January 5, 2022 04:26
@leolara
Copy link
Contributor Author

leolara commented Jan 5, 2022

In order to do not make the review too tedious and complicated, I have decided to stop considering it WIP, get it reviewed and merged, and then I will continue with a follow up PR with the rest of the renaming.

I have rebased on develop, no need to merge develop now.

Please review @terencechain or other :-)

@leolara leolara changed the title [WIP] #10036 Replace codename Merge with Bellatrix #10036 Replace codename Merge with Bellatrix (1st step) Jan 5, 2022
@terencechain terencechain marked this pull request as ready for review January 5, 2022 04:30
@@ -33,7 +33,7 @@ message GenericSignedBeaconBlock {
// Representing a signed, post-Altair fork beacon block.
SignedBeaconBlockAltair altair = 2;

// Representing a signed, post-Merge fork beacon block.
// Representing a signed, post-Bellatrix fork beacon block.
SignedBeaconBlockMerge merge = 3;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
SignedBeaconBlockMerge merge = 3;
SignedBeaconBlockBellatrix bellatrix = 3;

Just a reminder here so we don't forget. We can do this in a follow-up PR

terencechain
terencechain previously approved these changes Jan 5, 2022
@leolara leolara force-pushed the refactor/I10036/rename-merge-to-bellatrix branch from 30ff158 to 74689bf Compare January 6, 2022 03:02
@leolara
Copy link
Contributor Author

leolara commented Jan 6, 2022

@terencechain I rebased to fix conflict, it seems it needs further action from mantainers to merge

beacon-chain/db/kv/schema.go Outdated Show resolved Hide resolved
config/params/mainnet_config.go Outdated Show resolved Hide resolved
@@ -1073,7 +1073,7 @@ func (x *SyncAggregatorSelectionData) GetSubcommitteeIndex() uint64 {
return 0
}

type BeaconStateMerge struct {
type BeaconStateBellatrix struct {
Copy link
Member

Choose a reason for hiding this comment

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

Renaming in the generated code is not ideal. Please re-run ./hack/update-go-pbs.sh after modifying proto files.

The reason is that file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc attribute should be updated as well and it's some hex bytes so rebuilding the pb.go files is really the only way to do it. You may need to run gofmt or goimports to sort the imports for the linter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, many files regenerated and pushed

@leolara leolara force-pushed the refactor/I10036/rename-merge-to-bellatrix branch from e7c9fbe to 435c709 Compare January 10, 2022 11:03
@leolara
Copy link
Contributor Author

leolara commented Jan 10, 2022

@prestonvanloon @terencechain @rkapka I think all comments done, rebased to resolve conflicts.

Do you want me to squash when merging or merge normally?

Please, I think we need to move this, as this touches so many files many PRs will conflict this one

@leolara
Copy link
Contributor Author

leolara commented Jan 10, 2022

It seems the problems are not only conflicts with new additions, but also the use of symbols I have renamed in other PRs.

For example, I renamed version.Merge to version.Bellatrix, if someone uses version.Merge and merges a PR, then that symbol does not exist in my PR.

I think we should freeze merging other PRs until this is merged or it will be very difficult

@prestonvanloon
Copy link
Member

@leolara You need to run gofmt and goimports after regenerating protofiles.

gofmt -w **/*.go
goimports -w **/*.go

Git/Github is not letting me push to your branch. Please fix and we can merge quickly.

@leolara
Copy link
Contributor Author

leolara commented Jan 10, 2022

Ok

@leolara
Copy link
Contributor Author

leolara commented Jan 10, 2022

@prestonvanloon I ran those commands, but there were no effect, it seems my branch is clean or the problem is other

@leolara
Copy link
Contributor Author

leolara commented Jan 10, 2022

@prestonvanloon I changed a setting try to push to my branch now

prestonvanloon
prestonvanloon previously approved these changes Jan 10, 2022
@prylabs-bulldozer prylabs-bulldozer bot merged commit b1c2454 into prysmaticlabs:develop Jan 10, 2022
rkapka pushed a commit that referenced this pull request Jan 11, 2022
* Rename BeaconStateMerge to BeaconStateBellatrix

* Rename version.Merge to version.Bellatrix

* Rename ComputeFieldRootsWithHasherMerge to ComputeFieldRootsWithHasherBellatrix

* Rename test names to Bellatrix

* Rename comments and strings to Bellatrix

* Fix formatting in a few files

* Revert wrong renaming in test name

* Revert renaming to Bellatrix in mainnet_config.go

* Revert renaming of db key without migration

* Regenerate from proto changes

* Rename new use of already renamed symbols

* gofmt and goimports after regenerating protofiles

* revert weird imports

Co-authored-by: prestonvanloon <preston@prysmaticlabs.com>
(cherry picked from commit b1c2454)

# Conflicts:
#	beacon-chain/cache/sync_committee_head_state.go
#	beacon-chain/core/execution/upgrade.go
#	beacon-chain/state-proto/v3/state_trie.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace codename Merge with Bellatrix
6 participants