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

Include all upgradeable settings in the upgrade #3888

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

sisuresh
Copy link
Contributor

Description

  1. Update the upgrade test to create a single update that contains all upgradeable setting entries.
  2. Reduce a couple minimum settings. The most important change here is the reduction to TX_MAX_INSTRUCTIONS so only 1 vm can be instantiated. The min is 2,000,000, and the upgrade contract test currently uses 1476437.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

src/ledger/NetworkConfig.h Outdated Show resolved Hide resolved
@sisuresh sisuresh requested a review from dmkozh August 18, 2023 20:59
src/ledger/NetworkConfig.h Outdated Show resolved Hide resolved

static constexpr uint32_t TX_MAX_WRITE_LEDGER_ENTRIES = 2;
static constexpr uint32_t TX_MAX_WRITE_BYTES = 2'000;
static constexpr uint32_t TX_MAX_WRITE_BYTES = 3'000;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually not consistent with the entry and contract sizes. I think the following should be true:

TX_MAX_READ_BYTES == MAX_CONTRACT_DATA_KEY_SIZE_BYTES + MAX_CONTRACT_DATA_ENTRY_SIZE_BYTES && MAX_CONTRACT_SIZE == MAX_CONTRACT_DATA_ENTRY_SIZE_BYTES

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW we wanted MAX_CONTRACT_SIZE is kind of redundant; for v1 we decided to keep it consistent with the contract data entry size.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm good point. Shouldn't TX_MAX_WRITE_BYTES == MAX_CONTRACT_DATA_KEY_SIZE_BYTES + MAX_CONTRACT_DATA_ENTRY_SIZE_BYTES be true as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that would make sense as well. Maybe these should also be the validation conditions (with >=). These are not as critical to get right, but would be a bit annoying if messed up.

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 updated the settings. I don't think we need validation for this, but don't feel strongly so I can add it if you think we should.

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 this is a bit of a footgun, so I would prefer to have a validation on this. It's ok to do in a separate PR though.

src/ledger/NetworkConfig.h Show resolved Hide resolved
@dmkozh
Copy link
Contributor

dmkozh commented Aug 21, 2023

r+ de3feb4

@latobarita latobarita merged commit a5e8076 into stellar:master Aug 21, 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