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

Apply SBP review comments #166

Merged
merged 10 commits into from
Nov 13, 2023
Merged

Apply SBP review comments #166

merged 10 commits into from
Nov 13, 2023

Conversation

ghost
Copy link

@ghost ghost commented Nov 10, 2023

As a LAOS dev, I want to make sure that the review provided by the SBP is duly taken care of, so my code is better

ACCEPTANCE:

we apply the changes we deem necessary from the provided review
The review test:

Still relevant:

laos-ownership-node:
      - Runtime is using 60M as BlockGasLimit, it should be 15M.


It seems that `MAXIMUM_BLOCK_WEIGHT` is miscalculated:
          ```
          pub const MAXIMUM_BLOCK_WEIGHT: Weight =
            Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), 5 * 1024 * 1024);
          -->
          pub const MAXIMUM_BLOCK_WEIGHT: Weight =
            Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), 5 * 1024 * 1024);
          ```

We'd recommend to add the "txpool" RPC methods to your collators:
            https://github.com/paritytech/frontier/blob/master/template/node/src/rpc/eth.rs#L193

@ghost ghost marked this pull request as ready for review November 10, 2023 08:52
@ghost ghost requested review from asiniscalchi, magecnion and ccubu November 10, 2023 08:52
@ghost ghost self-assigned this Nov 10, 2023
@ghost ghost requested a review from tonimateos November 10, 2023 08:52
@ghost ghost linked an issue Nov 10, 2023 that may be closed by this pull request
@ghost
Copy link
Author

ghost commented Nov 10, 2023

/review

Copy link

PR Analysis

  • 🎯 Main theme: The PR seems to be focused on applying comments from a previous review, specifically related to the Ethereum compatibility layer and block weight computation in the Ownership chain.
  • 📝 PR summary: This PR applies changes to the Ethereum compatibility layer in the Ownership chain, including the addition of a transaction pool API server and changes to the filter pool. It also modifies the computation of the maximum block weight in the Ownership chain primitives, and adds a new feature flag for the transaction pool in the node's Cargo.toml.
  • 📌 Type of PR: Refactoring
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 3, due to the changes in multiple files and the need to understand the Ethereum compatibility layer and block weight computation.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The changes seem to be well thought out and are likely to improve the Ethereum compatibility of the Ownership chain. However, it would be beneficial to include more context in the PR description to help reviewers understand the motivation behind these changes. Additionally, it would be helpful to include tests to ensure that these changes work as expected.

  • 🤖 Code feedback:

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

///
/// Max PoV size is set to `5Mb` as all Cumulus-based parachains do.
pub const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), 5 * 1024 * 1024);
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), 5 * 1024 * 1024);
Copy link
Author

Choose a reason for hiding this comment

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

BlockGasLimit computation depends on this constant, so by changing this we also address the comment about gas limit (reducing it from 60M to 15M).

Copy link
Author

Choose a reason for hiding this comment

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

pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS);

@ghost ghost changed the title Apply SBP review Apply SBP review comments Nov 10, 2023
@asiniscalchi
Copy link
Member

/improve better name for the test

@asiniscalchi
Copy link
Member

/ask what about a better name for the test ?

Comment on lines 88 to +92
[features]
default = []
default = [
"txpool"
]
txpool = ["fc-rpc/txpool"]

Choose a reason for hiding this comment

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

Suggestion: Consider adding a description for the "txpool" feature for better understanding of its purpose.

Suggested change
[features]
default = []
default = [
"txpool"
]
txpool = ["fc-rpc/txpool"]
[features]
# Enables transaction pool functionality
default = [
"txpool"
]
txpool = ["fc-rpc/txpool"]

Copy link

Question: what about a better name for the test ?

Answer:
The test name test_constants is quite generic and does not provide much information about what the test is doing. It would be better to name tests in a way that describes their purpose or the specific functionality they are testing.

For instance, this test could be renamed to test_block_and_gas_limit_constants as it is specifically testing the block weights and gas limit constants. This would make it easier for other developers to understand what the test is for without having to read through the test code.

Remember, a good test name should quickly and accurately describe what the test does. It can be a bit longer if necessary - clarity is the key.

@freeverseio freeverseio deleted a comment from github-actions bot Nov 10, 2023
@freeverseio freeverseio deleted a comment from github-actions bot Nov 10, 2023
@freeverseio freeverseio deleted a comment from github-actions bot Nov 10, 2023
Copy link
Member

@asiniscalchi asiniscalchi left a comment

Choose a reason for hiding this comment

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

test to check txpool is working missing

@ghost ghost requested a review from asiniscalchi November 10, 2023 14:56
@asiniscalchi asiniscalchi merged commit 0164a4e into main Nov 13, 2023
7 checks passed
@asiniscalchi asiniscalchi deleted the fix/sbp-comments branch November 13, 2023 12:12
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.

Apply Substrate Review comments
3 participants