From 4eb4729a032c42365f3ff4445b494038057717bd Mon Sep 17 00:00:00 2001 From: TAKAMI Torao Date: Tue, 26 Jul 2022 14:20:43 +0900 Subject: [PATCH] change PubKey/PrivKey prefixes of "ostracon/" to "tendermint (#445) 1. The private key may remain "pstracon/PrivKeyXxx" as it's never exposed to outside world. However, it makes no sense to keep the ostracon prefix even with asymmetric naming, so it should be modified with "tendermint/PrivKeyXxx" 2. BLS12 and Composite key types are not compatible with current Cosmos assets to begin with. To make this clear, these Ostracon-specific prefixes are left as "ostracon/". --- config/toml.go | 8 ++++---- crypto/ed25519/ed25519.go | 4 ++-- crypto/secp256k1/secp256k1.go | 4 ++-- crypto/sr25519/encoding.go | 4 ++-- rpc/openapi/openapi.yaml | 10 +++++----- tools/tm-signer-harness/internal/test_harness_test.go | 6 +++--- types/genesis_test.go | 10 +++++----- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/config/toml.go b/config/toml.go index 0a6d52731..46a26a8b5 100644 --- a/config/toml.go +++ b/config/toml.go @@ -608,7 +608,7 @@ var testGenesisFmt = `{ "validators": [ { "pub_key": { - "type": "ostracon/PubKeyEd25519", + "type": "tendermint/PubKeyEd25519", "value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE=" }, "power": "10", @@ -626,18 +626,18 @@ var testGenesisFmt = `{ var testPrivValidatorKey = `{ "address": "A3258DCBF45DCA0DF052981870F2D1441A36D145", "pub_key": { - "type": "ostracon/PubKeyEd25519", + "type": "tendermint/PubKeyEd25519", "value": "AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE=" }, "priv_key": { - "type": "ostracon/PrivKeyEd25519", + "type": "tendermint/PrivKeyEd25519", "value": "EVkqJO/jIXp3rkASXfh9YnyToYXRXhBr6g9cQVxPFnQBP/5povV4HTjvsy530kybxKHwEi85iU8YL0qQhSYVoQ==" } }` var testNodeKey = `{ "priv_key": { - "type": "ostracon/PrivKeyEd25519", + "type": "tendermint/PrivKeyEd25519", "value": "hICuZLlVwHdzz6pAQOKk07MFn3Hze1EwwTUUhEDIdti9a1cQLR5Co/lxAzeGcyPWS/LuEr7qbgHmDUJT/nxx+Q==" } }` diff --git a/crypto/ed25519/ed25519.go b/crypto/ed25519/ed25519.go index 88035bbb5..4b8fe6803 100644 --- a/crypto/ed25519/ed25519.go +++ b/crypto/ed25519/ed25519.go @@ -20,8 +20,8 @@ import ( var _ crypto.PrivKey = PrivKey{} const ( - PrivKeyName = "ostracon/PrivKeyEd25519" - PubKeyName = "ostracon/PubKeyEd25519" + PrivKeyName = "tendermint/PrivKeyEd25519" + PubKeyName = "tendermint/PubKeyEd25519" // PubKeySize is is the size, in bytes, of public keys as used in this package. PubKeySize = 32 // PrivateKeySize is the size, in bytes, of private keys as used in this package. diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index 2d0f0b271..a1a2666f3 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -17,8 +17,8 @@ import ( //------------------------------------- const ( - PrivKeyName = "ostracon/PrivKeySecp256k1" - PubKeyName = "ostracon/PubKeySecp256k1" + PrivKeyName = "tendermint/PrivKeySecp256k1" + PubKeyName = "tendermint/PubKeySecp256k1" KeyType = "secp256k1" PrivKeySize = 32 diff --git a/crypto/sr25519/encoding.go b/crypto/sr25519/encoding.go index b55e11c9a..e04975164 100644 --- a/crypto/sr25519/encoding.go +++ b/crypto/sr25519/encoding.go @@ -8,8 +8,8 @@ import ( var _ crypto.PrivKey = PrivKey{} const ( - PrivKeyName = "ostracon/PrivKeySr25519" - PubKeyName = "ostracon/PubKeySr25519" + PrivKeyName = "tendermint/PrivKeySr25519" + PubKeyName = "tendermint/PubKeySr25519" // SignatureSize is the size of an Edwards25519 signature. Namely the size of a compressed // Sr25519 point, and a field element. Both of which are 32 bytes. diff --git a/rpc/openapi/openapi.yaml b/rpc/openapi/openapi.yaml index 5649c4fd7..c44b6920f 100644 --- a/rpc/openapi/openapi.yaml +++ b/rpc/openapi/openapi.yaml @@ -1254,7 +1254,7 @@ components: properties: type: type: string - example: "ostracon/PubKeyEd25519" + example: "tendermint/PubKeyEd25519" value: type: string example: "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" @@ -1698,7 +1698,7 @@ components: properties: type: type: string - example: "ostracon/PubKeyEd25519" + example: "tendermint/PubKeyEd25519" value: type: string example: "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" @@ -1857,7 +1857,7 @@ components: properties: type: type: string - example: "ostracon/PubKeyEd25519" + example: "tendermint/PubKeyEd25519" value: type: string example: "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM=" @@ -2028,7 +2028,7 @@ components: - "value" properties: type: - example: "ostracon/PubKeyEd25519" + example: "tendermint/PubKeyEd25519" value: type: "string" example: "VNMNfw7mrQBSpEvCtA9ykOe6BoR00RM9b/a9v3vXZhY=" @@ -2803,7 +2803,7 @@ components: properties: type: type: string - example: "ostracon/PubKeyEd25519" + example: "tendermint/PubKeyEd25519" value: type: string example: "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" diff --git a/tools/tm-signer-harness/internal/test_harness_test.go b/tools/tm-signer-harness/internal/test_harness_test.go index dc8005fde..61ad16567 100644 --- a/tools/tm-signer-harness/internal/test_harness_test.go +++ b/tools/tm-signer-harness/internal/test_harness_test.go @@ -21,11 +21,11 @@ const ( keyFileContents = `{ "address": "D08FCA3BA74CF17CBFC15E64F9505302BB0E2748", "pub_key": { - "type": "ostracon/PubKeyEd25519", + "type": "tendermint/PubKeyEd25519", "value": "ZCsuTjaczEyon70nmKxwvwu+jqrbq5OH3yQjcK0SFxc=" }, "priv_key": { - "type": "ostracon/PrivKeyEd25519", + "type": "tendermint/PrivKeyEd25519", "value": "8O39AkQsoe1sBQwud/Kdul8lg8K9SFsql9aZvwXQSt1kKy5ONpzMTKifvSeYrHC/C76Oqturk4ffJCNwrRIXFw==" } }` @@ -61,7 +61,7 @@ const ( { "address": "D08FCA3BA74CF17CBFC15E64F9505302BB0E2748", "pub_key": { - "type": "ostracon/PubKeyEd25519", + "type": "tendermint/PubKeyEd25519", "value": "ZCsuTjaczEyon70nmKxwvwu+jqrbq5OH3yQjcK0SFxc=" }, "power": "10", diff --git a/types/genesis_test.go b/types/genesis_test.go index 09fda990c..0a215e2b4 100644 --- a/types/genesis_test.go +++ b/types/genesis_test.go @@ -29,7 +29,7 @@ func TestGenesisBad(t *testing.T) { []byte( `{"validators":[` + `{"pub_key":{` + - `"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + + `"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + `},"power":"10","name":""}` + `]}`, ), @@ -37,7 +37,7 @@ func TestGenesisBad(t *testing.T) { []byte( `{"chain_id": "Lorem ipsum dolor sit amet, consectetuer adipiscing", "validators": [` + `{"pub_key":{` + - `"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + + `"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + `},"power":"10","name":""}` + `]}`, ), @@ -45,7 +45,7 @@ func TestGenesisBad(t *testing.T) { []byte( `{"chain_id":"mychain", "validators":[` + `{"address": "A", "pub_key":{` + - `"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + + `"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + `},"power":"10","name":""}` + `]}`, ), @@ -53,7 +53,7 @@ func TestGenesisBad(t *testing.T) { []byte( `{"chain_id":"mychain", "validators":[` + `{"pub_key":{` + - `"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + + `"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` + `},"power":"10","name":""}], ` + `"voter_params":{"voter_election_threshold":"1"}` + `}`, @@ -75,7 +75,7 @@ func TestGenesisGood(t *testing.T) { "initial_height": "1000", "consensus_params": null, "validators": [{ - "pub_key":{"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="}, + "pub_key":{"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="}, "power":"10", "name":"" }],