cleos sign produces inconsistent results
When the json file being signed is not in the same directory that cleos is run from, it produces inconsistent signatures. This is using cleos 1.0.5 on OSX
cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json | tail -n 5
private key: "signatures": [
"SIG_K1_JxUsq6aY3oN5ebpk9TdwaBjVe9icG75jRFKfu5tDbcpMf11hCHpNBVCR3ZCJeNKGTjDMUB4DDKae82jJhkGPvBVisJEEyK"
],
"context_free_data": []
}
cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json | tail -n 5
private key: "signatures": [
"SIG_K1_KcWA59zW8DwgyKnhDqKUsG2TQpbm8xujF6vYFCHBw6Yqcms1fgaN76zDxmaj76zos2j2hwHo2xtgNx7yow64sncWgiiJme"
],
"context_free_data": []
}
Now I move the json file to pwd
cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 upgrade_system_contract_official_trx.json | tail -n 5
private key: "signatures": [
"SIG_K1_KVkV1BEzv8WUSwPxu1Bzn7RyGvzeaSbz9WvuhHzzF7oVXpNVyw96NTRFyhxDcnBsC6oyTsPYjyL6rnihKiYGXK65JhaVWG"
],
"context_free_data": []
}
cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 upgrade_system_contract_official_trx.json | tail -n 5
private key: "signatures": [
"SIG_K1_KVkV1BEzv8WUSwPxu1Bzn7RyGvzeaSbz9WvuhHzzF7oVXpNVyw96NTRFyhxDcnBsC6oyTsPYjyL6rnihKiYGXK65JhaVWG"
],
"context_free_data": []
}
I am not able to reproduce this and cannot find anything in the code that could explain why you would get different signatures rerunning the same cleos sign command with the same private K1 key. Are you positive you are pasting in the same private key each time?
If you are still able to consistently rerun cleos sign with the same private K1 key and get different signatures can you do the following?
./cleos --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json > trx1.json
./cleos --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json > trx2.json
diff trx1.json trx2.json
We haven't received any update for this. Please test with the latest version to see if this still happens. If you still have the problem and wish to discuss further, please post it in https://eosio.stackexchange.com.