Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

drop query proofs in casting and agoric-cli #11022

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions multichain-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"devDependencies": {
"@agoric/cosmic-proto": "dev",
"@agoric/fast-usdc": "dev",
"@cosmjs/crypto": "^0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@cosmjs/crypto": "^0.33.0",
"@cosmjs/proto-signing": "^0.33.0",
"@cosmjs/stargate": "^0.33.0",
"@endo/errors": "^1.2.9",
"@endo/far": "^1.1.10",
"@endo/nat": "^5.0.14",
Expand Down
167 changes: 141 additions & 26 deletions multichain-testing/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ __metadata:
"@agoric/internal": "npm:^0.3.2"
"@agoric/notifier": "npm:^0.6.2"
"@agoric/store": "npm:^0.9.2"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/proto-signing": "npm:^0.32.3"
"@cosmjs/stargate": "npm:^0.32.3"
"@cosmjs/tendermint-rpc": "npm:^0.32.3"
"@cosmjs/encoding": "npm:^0.33.0"
"@cosmjs/proto-signing": "npm:^0.33.0"
"@cosmjs/stargate": "npm:^0.33.0"
"@cosmjs/tendermint-rpc": "npm:^0.33.0"
"@endo/errors": "npm:^1.2.9"
"@endo/far": "npm:^1.1.10"
"@endo/init": "npm:^1.1.8"
Expand All @@ -84,8 +84,8 @@ __metadata:
"@agoric/internal": "npm:^0.3.2"
"@agoric/smart-wallet": "npm:^0.5.3"
"@agoric/vats": "npm:^0.15.1"
"@cosmjs/stargate": "npm:^0.32.3"
"@cosmjs/tendermint-rpc": "npm:^0.32.3"
"@cosmjs/stargate": "npm:^0.33.0"
"@cosmjs/tendermint-rpc": "npm:^0.33.0"
"@endo/common": "npm:^1.2.9"
"@endo/errors": "npm:^1.2.9"
"@endo/marshal": "npm:^1.6.3"
Expand Down Expand Up @@ -138,8 +138,8 @@ __metadata:
"@agoric/vat-data": "npm:^0.5.2"
"@agoric/vow": "npm:^0.1.0"
"@agoric/zoe": "npm:^0.26.2"
"@cosmjs/proto-signing": "npm:^0.32.4"
"@cosmjs/stargate": "npm:^0.32.4"
"@cosmjs/proto-signing": "npm:^0.33.0"
"@cosmjs/stargate": "npm:^0.33.0"
"@endo/base64": "npm:^1.0.9"
"@endo/common": "npm:^1.2.9"
"@endo/errors": "npm:^1.2.9"
Expand Down Expand Up @@ -681,6 +681,18 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/amino@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/amino@npm:0.33.0"
dependencies:
"@cosmjs/crypto": "npm:^0.33.0"
"@cosmjs/encoding": "npm:^0.33.0"
"@cosmjs/math": "npm:^0.33.0"
"@cosmjs/utils": "npm:^0.33.0"
checksum: 10c0/35a4bc76aeb98b133a79cf015d2aaca7e2412f2fa6821efc0cadcd81a847f472fbdb24b0d3fe6aae06ec65058d3636137d67f55ec72d5311f6c4cef4ddb76d05
languageName: node
linkType: hard

"@cosmjs/crypto@npm:^0.32.3, @cosmjs/crypto@npm:^0.32.4":
version: 0.32.4
resolution: "@cosmjs/crypto@npm:0.32.4"
Expand All @@ -696,6 +708,21 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/crypto@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/crypto@npm:0.33.0"
dependencies:
"@cosmjs/encoding": "npm:^0.33.0"
"@cosmjs/math": "npm:^0.33.0"
"@cosmjs/utils": "npm:^0.33.0"
"@noble/hashes": "npm:^1"
bn.js: "npm:^5.2.0"
elliptic: "npm:^6.5.4"
libsodium-wrappers-sumo: "npm:^0.7.11"
checksum: 10c0/548006f8d028d5f931fd1fba4f919f2ed1b364cc3134f1c68a996503cf4124b3b0d27cbd7471cbbed2c88d014dffdb0cc61946417cf810f54476f5f62aeee10e
languageName: node
linkType: hard

"@cosmjs/encoding@npm:0.32.3":
version: 0.32.3
resolution: "@cosmjs/encoding@npm:0.32.3"
Expand All @@ -718,6 +745,17 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/encoding@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/encoding@npm:0.33.0"
dependencies:
base64-js: "npm:^1.3.0"
bech32: "npm:^1.1.4"
readonly-date: "npm:^1.0.0"
checksum: 10c0/c9586bea69da5b7a4eaa14f98522956bb8847ba6b3465b9f5adcd97ffa0cb25675dd5b8710feaae1a3fcd37c6709483a344fd6dc12689d1955fb83b82c03d59b
languageName: node
linkType: hard

"@cosmjs/json-rpc@npm:^0.32.4":
version: 0.32.4
resolution: "@cosmjs/json-rpc@npm:0.32.4"
Expand All @@ -728,6 +766,16 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/json-rpc@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/json-rpc@npm:0.33.0"
dependencies:
"@cosmjs/stream": "npm:^0.33.0"
xstream: "npm:^11.14.0"
checksum: 10c0/3f38317bc9da31c65a6631b8494843cc6be265e93df65727fc0c4b9121d1847bd2ec19fe1b77ad25df47e7e7160bae4792ecea335e5f4661feb9d43054a8f763
languageName: node
linkType: hard

"@cosmjs/math@npm:0.32.3":
version: 0.32.3
resolution: "@cosmjs/math@npm:0.32.3"
Expand All @@ -746,6 +794,15 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/math@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/math@npm:0.33.0"
dependencies:
bn.js: "npm:^5.2.0"
checksum: 10c0/03cfe1f177ee2f365f559419e60506b193a18e7535bfdf932f2ab10111cd114e96a6df7e8e2686d4fe4942093cc76f5dcf655722cacf0965194d88590a9e0303
languageName: node
linkType: hard

"@cosmjs/proto-signing@npm:0.32.3":
version: 0.32.3
resolution: "@cosmjs/proto-signing@npm:0.32.3"
Expand All @@ -760,7 +817,7 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/proto-signing@npm:^0.32.3, @cosmjs/proto-signing@npm:^0.32.4":
"@cosmjs/proto-signing@npm:^0.32.3":
version: 0.32.4
resolution: "@cosmjs/proto-signing@npm:0.32.4"
dependencies:
Expand All @@ -774,6 +831,20 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/proto-signing@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/proto-signing@npm:0.33.0"
dependencies:
"@cosmjs/amino": "npm:^0.33.0"
"@cosmjs/crypto": "npm:^0.33.0"
"@cosmjs/encoding": "npm:^0.33.0"
"@cosmjs/math": "npm:^0.33.0"
"@cosmjs/utils": "npm:^0.33.0"
cosmjs-types: "npm:^0.9.0"
checksum: 10c0/7f9ebc676249db180191bd3ffc84481341482c7c6d03c82a6cbd0350bdd17862e2058882044ec68e8d01aa11c600c79c9c11ef5dbdc0bc6382c708cf1d1a12b8
languageName: node
linkType: hard

"@cosmjs/socket@npm:^0.32.4":
version: 0.32.4
resolution: "@cosmjs/socket@npm:0.32.4"
Expand All @@ -786,6 +857,18 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/socket@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/socket@npm:0.33.0"
dependencies:
"@cosmjs/stream": "npm:^0.33.0"
isomorphic-ws: "npm:^4.0.1"
ws: "npm:^7"
xstream: "npm:^11.14.0"
checksum: 10c0/6d3b135eebe7292e07b4df6d2c0de980cfee9da4377c668d7bbdfa7103fbaefafd14c55db76799312af670a85ee85a61d0dbe06edc5e33780fe9fa17fef7fedf
languageName: node
linkType: hard

"@cosmjs/stargate@npm:0.32.3":
version: 0.32.3
resolution: "@cosmjs/stargate@npm:0.32.3"
Expand All @@ -804,21 +887,19 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/stargate@npm:^0.32.3, @cosmjs/stargate@npm:^0.32.4":
version: 0.32.4
resolution: "@cosmjs/stargate@npm:0.32.4"
"@cosmjs/stargate@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/stargate@npm:0.33.0"
dependencies:
"@confio/ics23": "npm:^0.6.8"
"@cosmjs/amino": "npm:^0.32.4"
"@cosmjs/encoding": "npm:^0.32.4"
"@cosmjs/math": "npm:^0.32.4"
"@cosmjs/proto-signing": "npm:^0.32.4"
"@cosmjs/stream": "npm:^0.32.4"
"@cosmjs/tendermint-rpc": "npm:^0.32.4"
"@cosmjs/utils": "npm:^0.32.4"
"@cosmjs/amino": "npm:^0.33.0"
"@cosmjs/encoding": "npm:^0.33.0"
"@cosmjs/math": "npm:^0.33.0"
"@cosmjs/proto-signing": "npm:^0.33.0"
"@cosmjs/stream": "npm:^0.33.0"
"@cosmjs/tendermint-rpc": "npm:^0.33.0"
"@cosmjs/utils": "npm:^0.33.0"
cosmjs-types: "npm:^0.9.0"
xstream: "npm:^11.14.0"
checksum: 10c0/c30a3519516aaa7eae58ba827c80fcf74c7fe7a9d3aa5cc8138c3a2768f5f241f59c2f5cec27e9037b4df12b1c6605b4fac9eadb4de97bd84edddc3a80a02e24
checksum: 10c0/5f1a93f91a146cfb7c3588271c78ee5102628a8c8948b5df42f5fde7d67cd0610d83bc26654dd535f2af43095a27577e00ea5b8f5cb0aa3f1fdcd4683cc235ab
languageName: node
linkType: hard

Expand All @@ -831,7 +912,16 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/tendermint-rpc@npm:^0.32.3, @cosmjs/tendermint-rpc@npm:^0.32.4":
"@cosmjs/stream@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/stream@npm:0.33.0"
dependencies:
xstream: "npm:^11.14.0"
checksum: 10c0/707ed2e9846eedb815fe7b56e79ad5a22055600b1be78754374d2613967dd68520773e3253e5dd4a0db4e8a3cd771d090d1c9e820bf9e0dd4fb146b138185198
languageName: node
linkType: hard

"@cosmjs/tendermint-rpc@npm:^0.32.3":
version: 0.32.4
resolution: "@cosmjs/tendermint-rpc@npm:0.32.4"
dependencies:
Expand All @@ -849,13 +939,38 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/tendermint-rpc@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/tendermint-rpc@npm:0.33.0"
dependencies:
"@cosmjs/crypto": "npm:^0.33.0"
"@cosmjs/encoding": "npm:^0.33.0"
"@cosmjs/json-rpc": "npm:^0.33.0"
"@cosmjs/math": "npm:^0.33.0"
"@cosmjs/socket": "npm:^0.33.0"
"@cosmjs/stream": "npm:^0.33.0"
"@cosmjs/utils": "npm:^0.33.0"
axios: "npm:^1.6.0"
readonly-date: "npm:^1.0.0"
xstream: "npm:^11.14.0"
checksum: 10c0/bf6bdfc96659527085cefd5d91a28e6a250b76dd4db00dc5958f1539e17f43240ea340e90322b4029f6101fc2d0ceb93cdc0a7262f8dda48142bc1ae0e85b57c
languageName: node
linkType: hard

"@cosmjs/utils@npm:^0.32.3, @cosmjs/utils@npm:^0.32.4":
version: 0.32.4
resolution: "@cosmjs/utils@npm:0.32.4"
checksum: 10c0/d5ff8b235094be1150853a715116049f73eb5cdfeea8ce8e22ecccc61ec99792db457404d4307782b1a2f935dcf438f5c485beabfcfbc1dc5df26eb6e6da9062
languageName: node
linkType: hard

"@cosmjs/utils@npm:^0.33.0":
version: 0.33.0
resolution: "@cosmjs/utils@npm:0.33.0"
checksum: 10c0/9cf4ac04031fcfa4bee8732bdff17d15a5bad76a208fabed3e85d9187f5ff483f9efcf0979751745278c35f4f3537005c9a124598c8e0ed4734524e73f5090a7
languageName: node
linkType: hard

"@endo/base64@npm:^1.0.9":
version: 1.0.9
resolution: "@endo/base64@npm:1.0.9"
Expand Down Expand Up @@ -4905,9 +5020,9 @@ __metadata:
dependencies:
"@agoric/cosmic-proto": "npm:dev"
"@agoric/fast-usdc": "npm:dev"
"@cosmjs/crypto": "npm:^0.32.4"
"@cosmjs/proto-signing": "npm:^0.32.4"
"@cosmjs/stargate": "npm:^0.32.4"
"@cosmjs/crypto": "npm:^0.33.0"
"@cosmjs/proto-signing": "npm:^0.33.0"
"@cosmjs/stargate": "npm:^0.33.0"
"@endo/errors": "npm:^1.2.9"
"@endo/far": "npm:^1.1.10"
"@endo/nat": "npm:^5.0.14"
Expand Down
10 changes: 5 additions & 5 deletions packages/agoric-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
"@agoric/zoe": "^0.26.2",
"@agoric/zone": "^0.2.2",
"@confio/relayer": "^0.11.3",
"@cosmjs/crypto": "^0.32.3",
"@cosmjs/encoding": "^0.32.3",
"@cosmjs/math": "^0.32.3",
"@cosmjs/proto-signing": "^0.32.3",
"@cosmjs/stargate": "^0.32.3",
"@cosmjs/crypto": "^0.33.0",
"@cosmjs/encoding": "^0.33.0",
"@cosmjs/math": "^0.33.0",
"@cosmjs/proto-signing": "^0.33.0",
"@cosmjs/stargate": "^0.33.0",
"@endo/bundle-source": "^3.5.1",
"@endo/captp": "^4.4.4",
"@endo/compartment-mapper": "^1.5.0",
Expand Down
13 changes: 0 additions & 13 deletions packages/agoric-cli/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,6 @@ const main = async (progname, rawArgs, powers) => {

baseCmd('follow <path-spec...>')
.description('follow an Agoric Casting leader')
.option(
'--proof <strict | optimistic | none>',
'set proof mode',
value => {
assert(
['strict', 'optimistic', 'none'].includes(value),
X`--proof must be one of 'strict', 'optimistic', or 'none'`,
TypeError,
);
return value;
},
'optimistic',
)
.option(
Copy link
Member

@michaelfig michaelfig Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't make an unnecessary breaking change here. --proof=none is still legitimate.

Suggested change
.option(
.option(
'--proof <none>',
`set proof mode (currently only 'none' is supported)`,
value => {
assert.equal(
value,
'none',
X`--proof can only be 'none'`,
TypeError,
);
return value;
},
'none',
)
.option(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair. I'll include something about the option being deprecated since it doesn't do anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I edited the above to suggest something better than before. Please take it into account.

'--sleep <seconds>',
'sleep <seconds> between polling (may be fractional)',
Expand Down
8 changes: 4 additions & 4 deletions packages/casting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@agoric/internal": "^0.3.2",
"@agoric/notifier": "^0.6.2",
"@agoric/store": "^0.9.2",
"@cosmjs/encoding": "^0.32.3",
"@cosmjs/proto-signing": "^0.32.3",
"@cosmjs/stargate": "^0.32.3",
"@cosmjs/tendermint-rpc": "^0.32.3",
"@cosmjs/encoding": "^0.33.0",
"@cosmjs/proto-signing": "^0.33.0",
"@cosmjs/stargate": "^0.33.0",
"@cosmjs/tendermint-rpc": "^0.33.0",
"@endo/errors": "^1.2.9",
"@endo/far": "^1.1.10",
"@endo/init": "^1.1.8",
Expand Down
13 changes: 8 additions & 5 deletions packages/casting/src/follower-cosmjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ const collectSingle = values => {
return head[0];
};

// NB: 'none' is the only value that works. We've left the other cases
// in anticipation of the ecosystem providing JS proofs again.
// See https://github.com/cosmos/cosmjs/issues/1618#issuecomment-2574934505
// and https://github.com/cosmos/ics23/pull/353?email_source=slack
// Coordinate with switch/case of tryGetDataAtHeight.
const proofs = ['strict', 'none', 'optimistic'];

Expand All @@ -110,7 +114,7 @@ export const makeCosmjsFollower = (
const {
decode = MAKE_DEFAULT_DECODER(),
unserializer = MAKE_DEFAULT_UNSERIALIZER(),
proof = 'optimistic',
proof = 'none',
crasher = null,
} = options;

Expand Down Expand Up @@ -217,14 +221,13 @@ export const makeCosmjsFollower = (
};

/**
* @deprecated no longer supported https://github.com/cosmos/cosmjs/pull/1623
* @param {number} [height]
* @returns {Promise<QueryStoreResponse>}
*/
const getProvenDataAtHeight = async height => {
return retryGetPrefixedData(async (endpoint, storeName, storeSubkey) => {
const queryClient = await provideQueryClient(endpoint);
return E(queryClient).queryStoreVerified(storeName, storeSubkey, height);
});
console.error('getProvenDataAtHeight', height, 'is no longer supported');
throw makeError(X`Verified queries are no longer supported`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't break anything? I'd expect at least that the old default "optimistic" starts showing a lot of errors/warnings, but I'm not sure where, and tests won't exactly catch noisy logs. Maybe we could make a temporary change to fail earlier if the proof is "optimistic" so we can see if any tests fail? Then we'd know which code is impacted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's marked as a breaking change, but no CI tests were affected. I don't think anyone was opting into optimistic or strict, but if they were there's not really anything more we can do. There's no implementation anymore.

In this case I think it's best to fail loudly so any code expecting verification fails and can be updated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I think it's best to fail loudly so any code expecting verification fails and can be updated.

Right, this will fail loudly for strict, but for optimistic which is the default, the follower will yield the data and then throw later when this proof verification fails. I don't think this would "break" anything, but result in some noisy logs saying the proofs failed. I was thinking it might be better to throw earlier, so that we can catch those cases, but if no one was using optimistic then that's moot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a problem but I'm pretty sure this PR changes the default to 'none'.

Comment on lines +229 to +230
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.error('getProvenDataAtHeight', height, 'is no longer supported');
throw makeError(X`Verified queries are no longer supported`);
console.error('getProvenDataAtHeight', height, 'is no longer supported; use', { proof: 'none' });
throw makeError(X`Verified queries are no longer supported; use { proof: 'none' }`);

};

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/client-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@agoric/internal": "^0.3.2",
"@agoric/smart-wallet": "^0.5.3",
"@agoric/vats": "^0.15.1",
"@cosmjs/stargate": "^0.32.3",
"@cosmjs/tendermint-rpc": "^0.32.3",
"@cosmjs/stargate": "^0.33.0",
"@cosmjs/tendermint-rpc": "^0.33.0",
"@endo/common": "^1.2.9",
"@endo/errors": "^1.2.9",
"@endo/marshal": "^1.6.3",
Expand Down
Loading
Loading