-
Notifications
You must be signed in to change notification settings - Fork 131
[bug]: SyncUniverse
RPC's sync_mode=1
option not working reliably
#1484
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
Comments
Here is my network topology
|
This is expected. You can't sync transfer proofs without first knowing about the issuance of an asset. |
I take a look at the itests and we have Zane as the proof courier and then we seem to sync dave, erin, fabia, yara to charlie but I'm not sure why they sync universes with charlie instead of zane who is supposed to be the proof courier?
|
Why can bob sync the universe of alice without requesting a transfer of the issuance proof first? Why was it not required in older versions of tapd to transfer the issuance proof first? |
SYNC_FULL why would I expect to need to do something else first to get all asset proofs? |
In my code I'm using |
By default, syncing proofs is "pull", not "pull and push". The exception is if you actually add a universe as a federation server before minting an asset, then the issuance proof will be pushed to the federation universe servers on minting. In our itests we use Zane as the proof courier only. Meaning, it will not act as a full universe, only for facilitating the transfers. The reason we sync all the nodes to Charlie instead of Zane is because Charlie mints the asset. So it already has the issuance proofs the others need to know about to know how to receive the assets. So tl;dr, what you'll want is:
|
Above when I did
Is there a reason you don't make charlie the proof courier? |
If you're doing a full sync, the issuance proofs are synced first. But what a full sync does also depends on your sync configuration. See options like
Not a technical one. Just that we can be sure to exclude any side effects of a node using itself as the courier. And because it's easier to find out if the courier did its job if we can detect the proof in a different node's universe. |
I do have |
What is the non-default option I can set to do a push and pull? |
I think one confusion here is |
As a workaround, I've tried the following sequence:
This works about 50% of the time. When it does fail, it always fails with the step where |
I take some of this back. I looked closer at my error log and realized I had a second place in my code that also tried to sync universes, so both places weren't running the first sync with I've replaced both with the following sequence:
I've had 10 consecutive successful runs this way. It seems that |
SyncUniverse
RPC's sync_mode=1
option not working reliably
Have you added any of the relevant nodes to your universe federation? That flag controls if the universe federation should check the normal config, or just ignore that and try to sync all the assets periodically from the set of federation members. As far as the The sync all flag applies only to the passive federation nodes you can add. In your testbed, what does
Only taproot-assets/taprpc/universerpc/universe.proto Lines 417 to 428 in 851dcad
|
Also I edited the issue a bit to use |
cool, didn't know you could do that! |
|
I don't use a federation.
I feel like if I want to manually SyncUniverse with a specific peer, I should not need a federation. |
I'm trying to run https://github.com/lightninglabs/tapdvalidation with lightninglabs/lightning-terminal#987. I previously had to add
--taproot-assets.proofcourieraddr=universerpc://alice:8443
as a workaround to #1483 to get bob to sync universes with alice. However, I'm now getting the following issue when george is trying to useSyncUniverse
to get proofs from bob:This error did not come up in previous versions of litd/tapd/lnd.
I'm struggling to even find the error message in the taproot-assets source code.
If I jump into george and try to do the same thing with tapcli I get the same kind of error
If I then repeat the command, but change the
proof_type
it works.
Then, if I change the proof type back to transfer, it also works
controller-1 | alice funding a 9e23bd4b7b3704e0cecfdb292d2d7f021336907d080d6fcf31bddb20642b8add channel with bob
controller-1 | alice connecting to bob
controller-1 | syncing the universe of bob to alice (172.99.0.4:8443)
controller-1 | done syncing universe
controller-1 | mining 10 blocks
controller-1 | bob funding a normal sats channel with charlie
controller-1 | bob connecting to charlie
controller-1 | mining 10 blocks
controller-1 | mining 10 blocks
controller-1 | charlie funding a normal sats channel with dave
controller-1 | charlie connecting to dave
controller-1 | mining 10 blocks
controller-1 | mining 10 blocks
controller-1 | dave funding a normal sats channel with edward
controller-1 | dave connecting to edward
controller-1 | mining 10 blocks
controller-1 | mining 10 blocks
controller-1 | alice sending 500000000 of 9e23bd4b7b3704e0cecfdb292d2d7f021336907d080d6fcf31bddb20642b8add to bob on chain
controller-1 | syncing the universe of bob to alice (172.99.0.4:8443)
controller-1 | mining 10 blocks
controller-1 | bob funding a 9e23bd4b7b3704e0cecfdb292d2d7f021336907d080d6fcf31bddb20642b8add channel with george
controller-1 | bob connecting to george
controller-1 | syncing the universe of george to alice (172.99.0.4:8443)
controller-1 | unknown
controller-1 | ERROR MESSAGE: unable to sync universe: unable to register proofs: unable to register proofs: unable to batch verify issuance proofs: unable to fetch previous asset snapshot: unable to fetch previous proof: no universe proof found, id=(universe.Identifier) issuance-708e8571b2ca36efc260100e9525a5c1fd165cc64a147d7ec604c1ac63e490c3
controller-1 | , leaf_key=(universe.BaseLeafKey) {
controller-1 | OutPoint: (wire.OutPoint) ec2daff7e26eb56b2940ab484431d2fca30442131d3117dfb938de91a63605ab:0,
controller-1 | ScriptKey: (*asset.ScriptKey)(0xc004c54300)({
controller-1 | PubKey: (*secp256k1.PublicKey)(0xc003eba0a0)({
controller-1 | x: (secp256k1.FieldVal) e9fa1cb15a00e37ae2c8f37b94fdf71ccad02b1ac5e7aa945ae676e3cc449d5d,
controller-1 | y: (secp256k1.FieldVal) 76ee13ef5ee1fae1e5cce7f0fedc228462bb50f020fec9608972fac92cf81cb2
controller-1 | }),
controller-1 | TweakedScriptKey: (*asset.TweakedScriptKey)()
controller-1 | })
controller-1 | }
controller-1 | , new_script_key=027a1023b5d70bb7c36cc7a16e6011c9be4667671555e88ab949cf8460acbea522
controller-1 | syncing failed, trying again
controller-1 | Traceback (most recent call last):
controller-1 | File "/mini_META/scripts/init_network", line 149, in
controller-1 | OpenTaprootAssetChannel(funder='bob', peer='george', AssetID=TheAssetID, AssetCapacity=200000000)
controller-1 | File "/mini_META/scripts/mini_META_lib.py", line 551, in OpenTaprootAssetChannel
controller-1 | litd_node_objects[peer]['tapd'].sync_universe(universe_host=universe_host, sync_mode=1)
controller-1 | File "/usr/local/lib/python3.10/dist-packages/lndgrpc/errors.py", line 50, in wrapper
controller-1 | raise exc
controller-1 | File "/usr/local/lib/python3.10/dist-packages/lndgrpc/errors.py", line 26, in wrapper
controller-1 | return fnc(*args, **kwargs)
controller-1 | File "/usr/local/lib/python3.10/dist-packages/lndgrpc/universe.py", line 20, in sync_universe
controller-1 | response = self.get_universe_stub().SyncUniverse(request)
controller-1 | File "/usr/local/lib/python3.10/dist-packages/grpc/_channel.py", line 1181, in call
controller-1 | return _end_unary_response_blocking(state, call, False, None)
controller-1 | File "/usr/local/lib/python3.10/dist-packages/grpc/_channel.py", line 1006, in _end_unary_response_blocking
controller-1 | raise _InactiveRpcError(state) # pytype: disable=not-instantiable
controller-1 | grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
controller-1 | status = StatusCode.UNKNOWN
controller-1 | details = "unable to sync universe: unable to register proofs: unable to register proofs: unable to batch verify issuance proofs: unable to fetch previous asset snapshot: unable to fetch previous proof: no universe proof found, id=(universe.Identifier) issuance-708e8571b2ca36efc260100e9525a5c1fd165cc64a147d7ec604c1ac63e490c3
controller-1 | , leaf_key=(universe.BaseLeafKey) {
controller-1 | OutPoint: (wire.OutPoint) ec2daff7e26eb56b2940ab484431d2fca30442131d3117dfb938de91a63605ab:0,
controller-1 | ScriptKey: (*asset.ScriptKey)(0xc004c54300)({
controller-1 | PubKey: (*secp256k1.PublicKey)(0xc003eba0a0)({
controller-1 | x: (secp256k1.FieldVal) e9fa1cb15a00e37ae2c8f37b94fdf71ccad02b1ac5e7aa945ae676e3cc449d5d,
controller-1 | y: (secp256k1.FieldVal) 76ee13ef5ee1fae1e5cce7f0fedc228462bb50f020fec9608972fac92cf81cb2
controller-1 | }),
controller-1 | TweakedScriptKey: (*asset.TweakedScriptKey)()
controller-1 | })
controller-1 | }
controller-1 | , new_script_key=027a1023b5d70bb7c36cc7a16e6011c9be4667671555e88ab949cf8460acbea522"
controller-1 | debug_error_string = "UNKNOWN:Error received from peer ipv4:172.99.0.10:8443 {created_time:"2025-04-24T05:36:15.574152077-04:00", grpc_status:2, grpc_message:"unable to sync universe: unable to register proofs: unable to register proofs: unable to batch verify issuance proofs: unable to fetch previous asset snapshot: unable to fetch previous proof: no universe proof found, id=(universe.Identifier) issuance-708e8571b2ca36efc260100e9525a5c1fd165cc64a147d7ec604c1ac63e490c3\n, leaf_key=(universe.BaseLeafKey) {\n OutPoint: (wire.OutPoint) ec2daff7e26eb56b2940ab484431d2fca30442131d3117dfb938de91a63605ab:0,\n ScriptKey: (*asset.ScriptKey)(0xc004c54300)({\n PubKey: (*secp256k1.PublicKey)(0xc003eba0a0)({\n x: (secp256k1.FieldVal) e9fa1cb15a00e37ae2c8f37b94fdf71ccad02b1ac5e7aa945ae676e3cc449d5d,\n y: (secp256k1.FieldVal) 76ee13ef5ee1fae1e5cce7f0fedc228462bb50f020fec9608972fac92cf81cb2\n }),\n TweakedScriptKey: (*asset.TweakedScriptKey)()\n })\n}\n, new_script_key=027a1023b5d70bb7c36cc7a16e6011c9be4667671555e88ab949cf8460acbea522"}"
controller-1 | >
The text was updated successfully, but these errors were encountered: