taproot-assets
taproot-assets copied to clipboard
[bug]: restart tapd will reset FedGlobalSyncConfig when with the --universe.public-access flag.
Start tapd with the --universe.public-access flag. Modify the settings accordingly. Restart tapd. The FedGlobalSyncConfig will be reset to its initial values. And then tapd will cost a long time and cpu to sync assets from lightning labs's universe
To prevent this, I suggest implementing an initialization check in server.go.
if s.cfg.UniversePublicAccess {
err := s.cfg.UniverseFederation.SetAllowPublicAccess()
if err != nil {
return fmt.Errorf("unable to set public access "+
"for universe federation: %w", err)
}
}
Thanks for the report
Restart tapd
When the tapd daemon is started for a second time (the restart), is the --universe.public-access
flag being set?
yeah, --universe.public-access flag is being set.
Ran into this myself, pretty annoying.
Here's a suggestion on how to resolve this:
- Separate the config for allowed actions to your own personal universe server vs how to sync with a remote universe server.
- The existing args stay, these govern your own personal universe server. When you do
--universe.public-access
, this means that you let people both read from your server, and also insert new proofs into your server.- By default with this, you won't actively sync all records from a remote/default universe server.
- We add a new set of flags to govern how sync works. The default is sync nothing. You can add
--universe.sync-all-assets
to indicate you want to attempt to sync any universe root you can find. Today we haveimport
, andexport
. This adds a third option:sync
. - In the auto syncer, when we go to sync, we'll look at this flag to see if it should be done at all. If so, then we look at the global or local flags to determine what to sync.