Problem with mine-empty-rounds = 0

+2 votes
If I run a blockchain with params below

the command
> multichain-cli catena publish root t1 ae

outputs
{"method":"publish","params":[

"root","t1","ae"],"id":1,"chain_name":"catena"}

error code: -4
error message:
No unspent outputs are available. Please send a transaction, with zero amount, to this node or address first and wait for its confirmation.

If instead I put
mine-empty-rounds = -1
or
mine-empty-rounds = n, n>0 (e.g. 5)

taking all other parameters the same it works fine.

What is the problem?

 

# ==== MultiChain configuration file ====
# Created by multichain-util
# Protocol version: 10007
# This parameter set is VALID.
# Basic chain parameters

chain-protocol = multichain            
chain-description = Blockchain privata
root-stream-name = root      
root-stream-open = false              
chain-is-testnet = true        
target-block-time = 60                 
maximum-block-size = 8388608           
# Global permissions
anyone-can-connect = false             
anyone-can-send = false               
anyone-can-receive = false           
anyone-can-receive-empty = true        
anyone-can-create = false              
anyone-can-issue = false               
anyone-can-mine = false               
anyone-can-activate = false            
anyone-can-admin = false               
support-miner-precheck = true          
allow-p2sh-outputs = true              
allow-multisig-outputs = true          
# Consensus requirements
setup-first-blocks = 1               
mining-diversity = 0.9             
admin-consensus-admin = 0.6            
admin-consensus-activate = 0.6         
admin-consensus-mine = 0.6             
admin-consensus-create = 0.6           
admin-consensus-issue = 0.6           
# Defaults for node runtime parameters
lock-admin-mine-rounds = 10            
mining-requires-peers = true         
mine-empty-rounds = 0.0                
mining-turnover = 0.5              
# Native blockchain currency (likely not required)
initial-block-reward = 0           
first-block-reward = -1                
reward-halving-interval = 52560000     
reward-spendable-delay = 1            
minimum-per-output = 0                
maximum-per-output = 0                
minimum-relay-fee = 0                  
native-currency-multiple = 100000000  
# Advanced mining parameters
skip-pow-check = true                  
pow-minimum-bits = 1                   
target-adjust-freq = -1                
allow-min-difficulty-blocks = false    
# Standard transaction definitions
only-accept-std-txs = false            
max-std-tx-size = 4194304             
max-std-op-returns-count = 10         
max-std-op-return-size = 2097152     
max-std-op-drops-count = 5             
max-std-element-size = 8192
asked Jun 29, 2017 by tim.sott

1 Answer

+1 vote

I'm not sure how it relates to mine-empty-rounds but in general the problem is that the node you are trying to publish from does not have any unspent transaction outputs (UTXOs).

For this node you are trying to publish from, presumably there is an address that was granted connect permissions. So this address should have a UTXO. The question is why it no longer has one – was anything else done on this node apart from connecting and try to publish? If this doesn't help can you send a full transcript of the steps you have taken on all nodes to reproduce this problem?

answered Jun 30, 2017 by MultiChain
I thought the prolem relates with ```mine-empty-rounds``` because by changing that parameter the problem disappear.
Anyway, here the steps. The situation is really simple: I have only one node, with all permission (obviously, it's the creator node).
From the beginning
> multichain-util create test
--change parmas as said above--
>multichaind test -daemon
>multichain-cli test publish root 1 00
--output:--
{"method":"publish","params":["root","1","00"],"id":1,"chain_name":"test"}

error code: -4
error message:
No unspent outputs are available. Please send a transaction, with zero amount, to this node or address first and wait for its confirmation.
We can't seem to reproduce this in the latest version (beta 2), so please try upgrading to that and see if that fixes it. It also uses protocol version 10008 by default.
I have upgraded to
MultiChain Core RPC client build 1.0 beta 2 protocol 10008
but, again, I have the same problem. The only steps I perform are
> multichain-util create oggi
MultiChain utilities build 1.0 beta 2 protocol 10008
Blockchain parameter set was successfully generated.

--> modify params.dat as said

>multichaind oggi -daemon

MultiChain Core Daemon build 1.0 beta 2 protocol 10008
MultiChain server starting
Looking for genesis block...
Genesis block found
Other nodes can connect to this node using:
multichaind oggi@*********
Node started
> multichain-cli oggi publish root 1 00
{"method":"publish","params":["root","1","00"],"id":1,"chain_name":"oggi"}
error code: -716
error message:
No unspent outputs are available. Please send a transaction, with zero amount, to this node or address first and wait for its confirmation.


--------------params.dat
# ==== MultiChain configuration file ====

# Created by multichain-util
# Protocol version: 10008

# This parameter set is VALID.
# To join network please run "multichaind oggi".
chain-protocol = multichain             
chain-description = MultiChain oggi     
root-stream-name = root                 
root-stream-open = false                
chain-is-testnet = false                
target-block-time = 60                 
maximum-block-size = 8388608          
# Global permissions
anyone-can-connect = false              
anyone-can-send = false                 
anyone-can-receive = false              
anyone-can-receive-empty = true         
anyone-can-create = false               
anyone-can-issue = false                
anyone-can-mine = false                 
anyone-can-activate = false             
anyone-can-admin = false               
support-miner-precheck = true          
allow-p2sh-outputs = true           
allow-multisig-outputs = true           
setup-first-blocks = 1                  
mining-diversity = 0.9                  
admin-consensus-upgrade = 0.6          
admin-consensus-admin = 0.6             
admin-consensus-activate = 0.6        
admin-consensus-mine = 0.6              
admin-consensus-create = 0.6            
admin-consensus-issue = 0.6             
# Defaults for node runtime parameters
lock-admin-mine-rounds = 10           
mining-requires-peers = true       
mine-empty-rounds = 0.0              
mining-turnover = 0.5                  
# Native blockchain currency (likely not required)
initial-block-reward = 0              
first-block-reward = -1                
reward-halving-interval = 52560000      
reward-spendable-delay = 1          
minimum-per-output = 0                 
maximum-per-output = 100000000000000    
minimum-relay-fee = 0                   
native-currency-multiple = 100000000    
# Advanced mining parameters
skip-pow-check = true                   
pow-minimum-bits = 1                    
target-adjust-freq = -1                
allow-min-difficulty-blocks = false     
# Standard transaction definitions
only-accept-std-txs = false             
max-std-tx-size = 4194304               
max-std-op-returns-count = 10        
max-std-op-return-size = 2097152       
max-std-op-drops-count = 5            
max-std-element-size = 8192
Thanks, we found the problem. The combination of setup-first-blocks=1 and mine-empty-rounds=0.0 means that the second block of the chain is not mined. Since the first UTXO comes from the genesis block reward, and reward-spendable-delay=1 (and can't be lower), you don't have a UTXO to spend.

The solution for now is to set setup-first-blocks=3 or more, and we'll look into resolving this problem in a broader way.
...