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

Generalize configuration-related XDR. #56

Closed
wants to merge 1 commit into from

Conversation

dmkozh
Copy link
Contributor

@dmkozh dmkozh commented Nov 18, 2022

The changes here reflect the recent updates to CAP-0046-09:

  • Use unique keys to identify settings
  • Only distribute a hash for config upgrades in StellarValue
  • Add SCP messages for exchanging config upgrade sets

The changes here are summarized in proposed updated to CAP-47 (stellar/stellar-protocol#1291).

- Use unique keys to identify settings
- Only distribute a hash for config upgrades in `StellarValue`
- Add SCP messages for exchanging config upgrade sets
@@ -263,6 +267,11 @@ case SURVEY_REQUEST:
case SURVEY_RESPONSE:
SignedSurveyResponseMessage signedSurveyResponseMessage;

case GET_CONFIG_UPGRADE_SET:
uint256 configUgradeSetHash;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: typo configUgradeSetHash -> configUpgradeSetHash

FLOOD_DEMAND = 19,

// Configuration upgrades
GET_CONFIG_UPGRADE_SET = 20,
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a high level question about the CAP. Would it be possible to force validators to have the ConfigUpgradeSets locally, and avoid having to make these overlay changes? Validators would call the upgrade command with the full xdr, save it, but then vote on the hash. I'm still working out if this can be used maliciously.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's an interesting idea. My only concern is that if we ever allow fuzzy upgrade matching, then this won't work. E.g. if a validator wants to use its own calibration data and computes a coefficient a 1000, while another one computers a coefficient of 1001. I don't know if that's ever a good idea though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I don't see how adding this fuzzy matching complexity is a good idea. Is that flexibility helpful? Which setting would be applied to the network (1000 vs 1001 in your example)?. Upgrade values are meant to be determined offline. Once validator operators agree on what the value should be, they submit the settings to the network.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The consensus could be done on e.g. the smallest hash. The reason would be so that validators could run the calibration themselves. Otherwise there needs to be some centralized distribution of the calibration data. That's probably fine in practice, but I'm not sure if we should eliminate this possibility. Maybe it's ok to leave it out at least for v1...

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a CAP where I can read about this "calibration"? I don't think I have a good understanding of what you're referring to, and adding support for this in the overlay and consensus seems like overkill for what you get.

@@ -520,20 +520,13 @@ case CONFIG_SETTING_TYPE_UINT32:

Copy link
Contributor

Choose a reason for hiding this comment

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

I think ConfigSettingType and ConfigSetting can be removed as they are not being used any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I understand; why are these not being used?

Copy link
Contributor

@jayz22 jayz22 Jan 13, 2023

Choose a reason for hiding this comment

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

These lines

enum ConfigSettingType
{
CONFIG_SETTING_TYPE_UINT32 = 0
};
union ConfigSetting switch (ConfigSettingType type)
{
case CONFIG_SETTING_TYPE_UINT32:
uint32 uint32Val;
};

are outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure they're deleted, maybe you are looking at some outdated version of the file (FWIW I see your comment attached to the initial version and not the changed one)

@sisuresh
Copy link
Contributor

Relevant work from this PR was merged in #75.

@sisuresh sisuresh closed this Apr 11, 2023
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.

3 participants