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

refactor: rename fields that correspond to the previous chunk #9500

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

pugachAG
Copy link
Contributor

@pugachAG pugachAG commented Sep 7, 2023

This PR adds prev_ prefix for chunk, chunk header and block header fields that represent values from the previous chunks. This change is important in the context of switching to Post-State-Root. There we will have most of the fields represent values of the current chunk, so having explicit prev_ prefix should emphasise that those fields contain values from the previous chunk.
This change is safe since field names are not used for serialisation because those structs only support Borsh serialization.

Part of #9450.

@pugachAG pugachAG marked this pull request as ready for review September 7, 2023 17:36
@pugachAG pugachAG requested a review from a team as a code owner September 7, 2023 17:36
@pugachAG pugachAG requested review from jakmeier and robin-near and removed request for jakmeier September 7, 2023 17:36
@pugachAG pugachAG added the A-chain Area: Chain, client & related label Sep 7, 2023
@pugachAG pugachAG marked this pull request as draft September 7, 2023 17:54
@pugachAG pugachAG marked this pull request as ready for review September 7, 2023 19:45
@pugachAG pugachAG changed the title refactor: rename chunk fields refactor: rename fields that correspond to the previous chunk Sep 7, 2023
@pugachAG pugachAG enabled auto-merge September 8, 2023 14:42
@pugachAG pugachAG added this pull request to the merge queue Sep 8, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 8, 2023
@pugachAG pugachAG added this pull request to the merge queue Sep 8, 2023
Merged via the queue into near:master with commit 23fe045 Sep 8, 2023
@pugachAG pugachAG deleted the chunk-renaming branch September 8, 2023 15:40
github-merge-queue bot pushed a commit that referenced this pull request Sep 22, 2023
Chunk header `gas_limit` was renamed to `prev_gas_limit` in
#9500. After discussion with
@jakmeier I've realised while it is determined in the previous chunk, it
actually corresponds to gas limit for the current chunk.
nikurt pushed a commit that referenced this pull request Sep 26, 2023
Chunk header `gas_limit` was renamed to `prev_gas_limit` in
#9500. After discussion with
@jakmeier I've realised while it is determined in the previous chunk, it
actually corresponds to gas limit for the current chunk.
nikurt pushed a commit that referenced this pull request Sep 26, 2023
Chunk header `gas_limit` was renamed to `prev_gas_limit` in
#9500. After discussion with
@jakmeier I've realised while it is determined in the previous chunk, it
actually corresponds to gas limit for the current chunk.
nikurt pushed a commit that referenced this pull request Oct 2, 2023
Chunk header `gas_limit` was renamed to `prev_gas_limit` in
#9500. After discussion with
@jakmeier I've realised while it is determined in the previous chunk, it
actually corresponds to gas limit for the current chunk.
nikurt pushed a commit that referenced this pull request Oct 11, 2023
Chunk header `gas_limit` was renamed to `prev_gas_limit` in
#9500. After discussion with
@jakmeier I've realised while it is determined in the previous chunk, it
actually corresponds to gas limit for the current chunk.
jancionear added a commit to jancionear/nearcore that referenced this pull request Jan 29, 2024
The `receipts` field in `PartialEncodedChunk` represents the outgoing
receipts of the previous chunk. Let's modify the name to make it more
descriptive: `prev_outgoing_receipts` is much clearer than just `receipts`.
The same name is already used in `ShardChunk`, so it'll make the code more
consistent and readable.

The change shouldn't break anything, the reasoning is the same as in
near#9500:

> This change is safe since field names are not used for serialisation because those structs only support Borsh serialization.
github-merge-queue bot pushed a commit that referenced this pull request Jan 30, 2024
The `receipts` field in `PartialEncodedChunk` represents the outgoing
receipts of the previous chunk. Let's modify the name to make it more
descriptive: `prev_outgoing_receipts` is much clearer than just
`receipts`. The same name is already used in `ShardChunk`, so it'll make
the code more consistent and readable.

The change shouldn't break anything, the reasoning is the same as in
#9500:

> This change is safe since field names are not used for serialisation
because those structs only support Borsh serialization.

This PR doesn't make any changes to the logic, it just renames
`receipts` to `prev_outgoing_receipts`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-chain Area: Chain, client & related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants