-
Notifications
You must be signed in to change notification settings - Fork 679
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
feat: Add Atlas configuration via Stacks.toml #3618
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3618 +/- ##
===========================================
- Coverage 84.84% 83.80% -1.04%
===========================================
Files 298 297 -1
Lines 276633 276103 -530
===========================================
- Hits 234697 231397 -3300
- Misses 41936 44706 +2770
... and 55 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
// Can't inplement `Into` trait because this takes a parameter | ||
fn into_config(&self, mainnet: bool) -> AtlasConfig { | ||
let mut conf = AtlasConfig::new(mainnet); | ||
if let Some(val) = self.attachments_max_size { |
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 maximum attachment size cannot be smaller than 1_048_576
. This is what the current maximum size is in the network, so we have to continue to provide at least that degree of service. Nodes can agree to store larger attachments if they want, however.
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'll add a constant ATTACHMENTS_MAX_SIZE_MIN
and default to that if the user sets a lower value. Should we use the current defaults to enforce minimum values for the other parameters in the [atlas]
config as well?
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.
Actually, it's probably better to crash with an error message on invalid config rather than applying hidden defaults. I'll do that instead
I have a few more ideas for Atlas improvements that I'd like to get some feedback on. I will probably make a new issue(s) for this work, but I'm going to start the conversation here, so I have some idea of what to do before creating it.
I'd like some feedback from people more familiar with the Stacks ecosystem, and distributed systems in general, to let me know if these ideas are feasible, if my assumptions are correct, and if there are better solutions. |
Sure; however, the BNS contract cannot be changed (generally goes for all contracts). You'll want to speak with the BNS X folks who are writing new wrappers around BNS to add new features.
Attachments are not stored in the mempool. They are only stored on the node that receives the transaction and attachment data from the client. The client could post this data to a few different public nodes and achieve the same end, however. |
I think this should be opened against |
dbe5ae6
to
35cd888
Compare
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.
This looks good to me, but it will have to be tested on some production nodes before this can merge.
…rve config data Co-authored-by: Aaron Blankstein <kantai@gmail.com>
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 -- please just open an issue for the genesis attachments point you raised.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
The following parameters can be used in Stacks.toml to configure Atlas database. Example (using defaults):
Applicable issues
Additional info (benefits, drawbacks, caveats)
I considered using https://crates.io/crates/validator_derive to implement Atlas config validation, but I know this project has a preference for not adding new dependencies, so I ended up doing it manually. This package could be used in a lot of places, and would result in code that is cleaner and less error prone, so it's worth considering adding it
Made a couple minor code quality improvements also:
AtlasConfig::default()
toAtlasConfig::new()
sincedefault()
shouldn't be used with parametersFeeEstimationConfigFile::default()
with#[derive(Default)]
Checklist
docs/rpc/openapi.yaml
andrpc-endpoints.md
for v2 endpoints,event-dispatcher.md
for new events)clarity-benchmarking
repobitcoin-tests.yml