-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Always create the FeeSettings object in genesis ledger #4319
Conversation
I think this fixes #3734 |
Not quite. This PR does create the Reviewers: If you haven't started reviewing yet, please hold off until I can do that. |
src/ripple/protocol/impl/SField.cpp
Outdated
@@ -234,6 +234,11 @@ CONSTRUCT_TYPED_SFIELD(sfRippleEscrow, "RippleEscrow", AMOUNT, | |||
CONSTRUCT_TYPED_SFIELD(sfDeliveredAmount, "DeliveredAmount", AMOUNT, 18); | |||
CONSTRUCT_TYPED_SFIELD(sfNFTokenBrokerFee, "NFTokenBrokerFee", AMOUNT, 19); | |||
|
|||
// currency amount (fees) | |||
CONSTRUCT_TYPED_SFIELD(sfBaseFeeDrops, "BaseFeeDrops", AMOUNT, 20); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number values here make a conflict with @RichardAH pull for Hooks values here: https://github.com/XRPLF/rippled/pull/4225/files#diff-24b5cf98b88491e906e2e365bfdbba35fffee45b36c1a52a1fb6dc539dd72023R239-R240
You should change the these values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the values over in the base PR, #4247
* Introduces amendment `featureXRPFees` * Includes Validations, Change transactions, the "Fees" ledger object, and subscription messages.
* For use with CDBC and sidechain projects that do not want to require fees. * Note that fee escalation logic is still in place, which may cause the open ledger fee to rise if the network is busy. 0 drop transactions will still queue, and fee escalation can be effectively disabled by modifying the configuration on all nodes.
* Break featureXRPCheck logic into multiple blocks. * Change default network reserves to match mainnet. * Add a isLegalAmountSigned check
* Initialize with default values from the config. Removes the need to pass a Config down into the Ledger initialization functions, including setup(). * Because old mainnet ledgers (prior to 562177 - yes, I looked it up), don't have FeeSettings, some of the other ctors will default them to the config values before setup() tries to load the object. * Update default Config fee values to match mainnet. * Fix unit tests: * Updated fees: Some tests are converted to use computed values of fee object, but the default Env config was also updated to fix the rest. * Unit tests that check the structure of the ledger have updated hashes and counts.
* upstream/develop: Add a unit test for invalid memos (XRPLF#4287)
* upstream/develop: Make NodeToShardRPC a manual test (XRPLF#4379) Update build instructions (XRPLF#4376)
* upstream/develop: Update BUILD.md (XRPLF#4383)
@intelliot I'm going to run a quick test of the changes I made to get rid of the undocumented config values while I grab some food, and I'll push if it looks good. |
Ok. I think it's really ready. @thejohnfreeman @nbougalis @intelliot The last commit finally gets rid of the "poorly documented" config settings for reserves, and uses the |
* upstream/develop: Set version to 1.10.0-rc4 Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442) Update Docker.md (XRPLF#4432) Update package building scripts and images to use Conan (XRPLF#4435) Disable duplicate detector: (XRPLF#4438)
* upstream/develop: Set version to 1.10.0
* upstream/develop: docs: security bug bounty acknowledgements (XRPLF#4460)
* upstream/develop: Rectify the import paths of boost/iterator: (XRPLF#4293) Allow port numbers be be specified with a colon: (XRPLF#4328) Use <=> operator for base_uint, Issue, and Book: (XRPLF#4411) Reporting Mode: Do not attempt to acquire missing data from peer network (XRPLF#4458)
* upstream/develop: docs: update protocol README (4457) `fixNFTokenRemint`: prevent NFT re-mint: (4406) fix: support RPC markers for any ledger object: (4361) refactor: optimize NodeStore object conversion: (4353) fix(ValidatorSite): handle rare null pointer dereference in timeout: (4420) fix(gateway_balances): handle overflow exception: (4355) Set version to 1.10.1-b1
@thejohnfreeman could you review this? (If not, please suggest 1-2 other potential reviewers.) |
src/test/app/RCLValidations_test.cpp
Outdated
@@ -108,7 +108,8 @@ class RCLValidations_test : public beast::unit_test::suite | |||
next->updateSkipList(); | |||
if (forceHash) | |||
{ | |||
next->setImmutable(config); | |||
BEAST_EXPECT(next->read(keylet::fees())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this expected only when forceHash
is set? I didn't go into the details of this test but the fees
is available regardless of forceHash
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I just put it there because I was changing the call to setImmutable
. I'll move it.
src/test/app/TxQ_test.cpp
Outdated
@@ -2944,7 +2944,7 @@ class TxQ1_test : public beast::unit_test::suite | |||
// we only see a reduction by 5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this comment be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll make it more vague. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I have two minor comments, which I assume would be addressed.
** Do not include this message in the squashed commit message * Move one of the tests and update a comment.
@ximinez please suggest a commit message for this PR (to use for the entire squashed changeset) |
|
* Create the FeeSettings object in genesis ledger. * Initialize with default values from the config. Removes the need to pass a Config down into the Ledger initialization functions, including setup(). * Drop the undocumented fee config settings in favor of the [voting] section. * Because old mainnet ledgers (prior to 562177 - yes, I looked it up), don't have FeeSettings, some of the other ctors will default them to the config values before setup() tries to load the object. * Update default Config fee values to match mainnet. * Fix unit tests: * Updated fees: Some tests are converted to use computed values of fee object, but the default Env config was also updated to fix the rest. * Unit tests that check the structure of the ledger have updated hashes and counts.
This assert was put in the wrong place, but it only triggers if shards are configured. This change moves the assert to the right place and updates it to ensure correctness. The assert could be hit after the server downloads some shards. It may be necessary to restart after the shards are downloaded. Note that asserts are normally checked only in debug builds, so release packages should not be affected. Introduced in: #4319 (66627b2)
High Level Overview of Change
This is a follow-up to #4247. Reviewers do not need to concern themselves with those commits, and can start at "Always create the FeeSettings object in genesis ledger".
Inspired by this comment (and previous discussions), this refactors the genesis ledger creation process to always create and initialize a
FeeSettings
object. This simplifies some of the downstream initialization functions, and removes the need to pass aConfig
object in as many places.This change does not require an amendment because it will have no meaningful effects processing transactions, syncing and staying up-to-date on any existing network, nor loading historical ledgers. In practical terms, it's more of a refactor that will slightly change the process for starting up a new network.
Type of Change
Test Plan
FeeSettings
object, initialized with the default fee values (10 drop base fee, 10 XRP account reserve, 2 XRP incremental reserve).