taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

[bug]: restart tapd will reset FedGlobalSyncConfig when with the --universe.public-access flag.

Open lukegao209 opened this issue 11 months ago • 3 comments

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)
		}
	}

lukegao209 avatar Mar 18 '24 03:03 lukegao209

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?

dstadulis avatar Mar 18 '24 14:03 dstadulis

yeah, --universe.public-access flag is being set.

lukegao209 avatar Mar 19 '24 00:03 lukegao209

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 have import, and export. 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.

Roasbeef avatar May 09 '24 00:05 Roasbeef