-
Notifications
You must be signed in to change notification settings - Fork 161
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
Move permanent flags to config file #1609
Conversation
77a4d86
to
57dd896
Compare
52ee6bb
to
5bfab2e
Compare
"insert_options": { | ||
"tx_out": "bootstrap" | ||
} | ||
} |
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.
unsure if you are already doing this but could these not be a single file with updated value, here is a simple example:
Lines 60 to 65 in 045330d
where | |
-- an example of how we will pass our custom configs overwriting the init file | |
mkSynNodeConfig :: IO SyncNodeConfig | |
mkSynNodeConfig = do | |
initConfigFile <- mkSyncNodeConfig conwayConfigDir | |
pure $ initConfigFile {dncEnableLogging = True} |
but for this scenarios it would be:
where
mkSynNodeConfig :: IO SyncNodeConfig
mkSynNodeConfig = do
-- have 1 init file that is read and parsed
initConfigFile <- mkSyncNodeConfig conwayConfigDir
-- update the results with required values for the specific test in above tests
-- it's "tx_out": "bootstrap" so that is reflected as so
pure $
initConfigFile
{ dncInsertConfig = initInsertConfig { spcTxOut = TxOutBootstrap } }
-- have an init for specific set of tests or all tests if required
initInsertConfig :: SyncInsertConfig
initInsertConfig =
SyncInsertConfig
{ spcTxOut = TxOutEnable
, spcLedger = LedgerEnable
, spcShelley = ShelleyDisable
...
}
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've written a couple new tests in this style, but the majority I've kept unchanged
b09f746
to
834c062
Compare
46d89d3
to
ff65b89
Compare
doc/configuration.md
Outdated
Disables fetching pool offchain metadata. | ||
**Only UTxO** | ||
|
||
This is the equivalent of using `--dont-use-ledger` `--disable-shelley`, |
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.
might want to mention that this refers to command line flags we previously had.
This equates to the following deprecated flags:
--dont-use-ledger
--disable-shelley
...
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 believe the docs should basically be finished now.
4ea34de
to
1c5b202
Compare
d1c61df
to
49a5723
Compare
Rather than from CLI args
The majority of flags that affect the insert configuration are now part of the primary configuration file for db-sync
49a5723
to
722d5a8
Compare
I had this error, which I think used to be a warning
This seems to hapen with "ledger" : "disable" or with some preset values. |
, enpSnEveryFollowing :: !Word64 | ||
, enpSnEveryLagging :: !Word64 | ||
, enpMaybeRollback :: !(Maybe SlotNo) | ||
, enpForceTxIn :: !Bool -- TODO[sgillespie] |
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 can probably be removed, since it's moved to TxOutConfig
Just "disable_all" -> pure DisableAllInsertOptions | ||
Just other -> fail $ "unexpected preset: " <> show other | ||
|
||
instance ToJSON SyncInsertConfig where |
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.
Are these ToJSON
necessary or used anywhere?
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.
These ToJSON
instances are used in Hedgehog roundtrip tests
disableAllInsertOptions = | ||
SyncInsertOptions | ||
{ sioTxOut = TxOutDisable | ||
, sioLedger = LedgerDisable |
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.
For onlyGovInsertOptions
the ledger should be enabled by default.
Ideally the ledger should remain an option even with preset insert configuration. For this pr it would be enough to change the only gov to have LedgerEnable
.
|
||
void $ case (maybeLedgerStateDir, ledgerCfg) of | ||
-- It's an error to disable ledger and specify the state dir | ||
(Just _, LedgerDisable) -> error stateDirErrorMsg |
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 this case should just give a warning
* force_tx_in * preset
Update docs to use the config file, rather than CLI args.
* Validate state-dir/ledger config * Lookup in/out from config * Disable rewards in some presets
8cafde8
to
9bc14a3
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.
Great work!
Description
Fixes #1576. Move configuration flags that can't be changed (disable-ledger, prune-tx-out, disable-shelley, and so on) and add them to the main configuration file.
Checklist
fourmolu
on version 0.10.1.0 (which can be run withscripts/fourmolize.sh
)Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.