Skip to content
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

'request body too large' at yarn start:contract after modifying provided contract #28

Closed
migueldingli1997 opened this issue Jan 2, 2024 · 3 comments
Assignees

Comments

@migueldingli1997
Copy link

Related to:

I've encountered a request body too large error when running yarn start:contract on a modified gameAssetContract.js file. I only applied two changes; the rest is a fresh clone via yarn create @agoric/dapp based on the latest commit at the time of writing, 774d182.

  • Change 1: import { assertIssuerKeywords } from "@agoric/zoe/src/contractSupport/index.js";
  • Change 2: assertIssuerKeywords(zcf, harden(['Price'])); in the start function
(Click me) Here's a complete dump of the yarn start:contract logging, which seems to show no problems up until the very end.
$ yarn start:contract
yarn run v1.22.21
$ cd contract && yarn start
$ yarn docker:make clean start-contract print-key
$ docker compose exec agd make -C /workspace/contract clean start-contract print-key
make: Entering directory '/workspace/contract'
./scripts/build-proposal.sh
Removing intrinsics.Symbol.dispose
Removing intrinsics.Symbol.asyncDispose
agoric: run: running /workspace/contract/scripts/build-game1-start.js
start-game1-proposal.js module evaluating
./scripts/install-bundles.sh
+ cd /workspace/contract
+ '[' -s bundles/bundle-list ']'
+ make mint4k
make[1]: Entering directory '/workspace/contract'
make FUNDS=1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA fund-acct
make[2]: Entering directory '/workspace/contract'
agd tx bank send validator agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5 1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA \
  --keyring-backend=test --chain-id=agoriclocal --gas=auto --gas-adjustment=1.2 --yes -b block \
  -o json >,tx.json
gas estimate: 87730
jq '{code: .code, height: .height}' ,tx.json
{
  "code": 0,
  "height": "1323"
}
make[2]: Leaving directory '/workspace/contract'
cd /usr/src/agoric-sdk && \
	yarn --silent agops vaults open --wantMinted 4000 --giveCollateral 1000 >/tmp/want4k.json && \
	yarn --silent agops perf satisfaction --executeOffer /tmp/want4k.json --from user1 --keyring-backend=test
Removing intrinsics.Symbol.dispose
Removing intrinsics.Symbol.asyncDispose
running with options {
  offerId: 'openVault-1704186360847',
  collateralBrand: 'ATOM',
  wantMinted: 4000,
  giveCollateral: 1000
}
Removing intrinsics.Symbol.dispose
Removing intrinsics.Symbol.asyncDispose
{
  sharedOpts: { keyringBackend: 'test' },
  opts: {
    executeOffer: '/tmp/want4k.json',
    from: 'agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5'
  }
}
Following :published.wallet.agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5
Executing  [
  '--node=http://0.0.0.0:26657',
  '--chain-id=agoriclocal',
  '--from=agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5',
  'tx',
  'swingset',
  'wallet-action',
  '--allow-spend',
  '{"body":"#{\\"method\\":\\"executeOffer\\",\\"offer\\":{\\"id\\":\\"openVault-1704186360847\\",\\"invitationSpec\\":{\\"callPipe\\":[[\\"getCollateralManager\\",[\\"$0.Alleged: BoardRemoteATOM brand\\"]],[\\"makeVaultInvitation\\"]],\\"instancePath\\":[\\"VaultFactory\\"],\\"source\\":\\"agoricContract\\"},\\"proposal\\":{\\"give\\":{\\"Collateral\\":{\\"brand\\":\\"$0\\",\\"value\\":\\"+1000000000\\"}},\\"want\\":{\\"Minted\\":{\\"brand\\":\\"$1.Alleged: BoardRemoteIST brand\\",\\"value\\":\\"+4000000000\\"}}}}}","slots":["board05557","board0257"]}\n',
  '--keyring-backend=test',
  '--yes'
]
wallet update {
  status: {
    id: 'openVault-1702496757032',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
wallet update {
  status: {
    id: 'openVault-1702496757032',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    numWantsSatisfied: 1,
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
wallet update {
  status: {
    id: 'openVault-1702496757032',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    numWantsSatisfied: 1,
    payouts: { Collateral: [Object], Minted: [Object] },
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
wallet update {
  status: {
    id: 'openVault-1704186360847',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
make[1]: Leaving directory '/workspace/contract'
+ make mint4k
make[1]: Entering directory '/workspace/contract'
make FUNDS=1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA fund-acct
make[2]: Entering directory '/workspace/contract'
agd tx bank send validator agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5 1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA \
  --keyring-backend=test --chain-id=agoriclocal --gas=auto --gas-adjustment=1.2 --yes -b block \
  -o json >,tx.json
gas estimate: 87730
jq '{code: .code, height: .height}' ,tx.json
{
  "code": 0,
  "height": "1352"
}
make[2]: Leaving directory '/workspace/contract'
cd /usr/src/agoric-sdk && \
	yarn --silent agops vaults open --wantMinted 4000 --giveCollateral 1000 >/tmp/want4k.json && \
	yarn --silent agops perf satisfaction --executeOffer /tmp/want4k.json --from user1 --keyring-backend=test
Removing intrinsics.Symbol.dispose
Removing intrinsics.Symbol.asyncDispose
running with options {
  offerId: 'openVault-1704186411179',
  collateralBrand: 'ATOM',
  wantMinted: 4000,
  giveCollateral: 1000
}
Removing intrinsics.Symbol.dispose
Removing intrinsics.Symbol.asyncDispose
{
  sharedOpts: { keyringBackend: 'test' },
  opts: {
    executeOffer: '/tmp/want4k.json',
    from: 'agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5'
  }
}
Following :published.wallet.agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5
Executing  [
  '--node=http://0.0.0.0:26657',
  '--chain-id=agoriclocal',
  '--from=agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5',
  'tx',
  'swingset',
  'wallet-action',
  '--allow-spend',
  '{"body":"#{\\"method\\":\\"executeOffer\\",\\"offer\\":{\\"id\\":\\"openVault-1704186411179\\",\\"invitationSpec\\":{\\"callPipe\\":[[\\"getCollateralManager\\",[\\"$0.Alleged: BoardRemoteATOM brand\\"]],[\\"makeVaultInvitation\\"]],\\"instancePath\\":[\\"VaultFactory\\"],\\"source\\":\\"agoricContract\\"},\\"proposal\\":{\\"give\\":{\\"Collateral\\":{\\"brand\\":\\"$0\\",\\"value\\":\\"+1000000000\\"}},\\"want\\":{\\"Minted\\":{\\"brand\\":\\"$1.Alleged: BoardRemoteIST brand\\",\\"value\\":\\"+4000000000\\"}}}}}","slots":["board05557","board0257"]}\n',
  '--keyring-backend=test',
  '--yes'
]
wallet update {
  status: {
    id: 'openVault-1704186360847',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
wallet update {
  status: {
    id: 'openVault-1704186360847',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    numWantsSatisfied: 1,
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
wallet update {
  status: {
    id: 'openVault-1704186360847',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    numWantsSatisfied: 1,
    payouts: { Collateral: [Object], Minted: [Object] },
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
wallet update {
  status: {
    id: 'openVault-1704186411179',
    invitationSpec: {
      callPipe: [Array],
      instancePath: [Array],
      source: 'agoricContract'
    },
    proposal: { give: [Object], want: [Object] },
    result: 'UNPUBLISHED'
  },
  updated: 'offerStatus'
}
make[1]: Leaving directory '/workspace/contract'
+ make balance-q
make[1]: Entering directory '/workspace/contract'
agd keys show user1 -a --keyring-backend="test"
agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5
agd query bank balances agoric1xe269y3fhye8nrlduf826wgn499y6wmnv32tw5
balances:
- amount: "1000000000"
  denom: ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA
- amount: "10000000"
  denom: ubld
- amount: "8000850000"
  denom: uist
pagination:
  next_key: null
  total: "0"
make[1]: Leaving directory '/workspace/contract'
++ cat bundles/bundle-list
+ for b in $(cat bundles/bundle-list)
+ echo installing /root/.agoric/cache/b1-ac10d0dd844aa725558f0eed5a8e262db9d0cef1fd5d8e8c2d6ab6eef50ac95d2418b0c7a900e048528099b85ab70e4f7db0831fb444b2637e264601e93221af.json
installing /root/.agoric/cache/b1-ac10d0dd844aa725558f0eed5a8e262db9d0cef1fd5d8e8c2d6ab6eef50ac95d2418b0c7a900e048528099b85ab70e4f7db0831fb444b2637e264601e93221af.json
+ install_bundle /root/.agoric/cache/b1-ac10d0dd844aa725558f0eed5a8e262db9d0cef1fd5d8e8c2d6ab6eef50ac95d2418b0c7a900e048528099b85ab70e4f7db0831fb444b2637e264601e93221af.json
+ ls -sh /root/.agoric/cache/b1-ac10d0dd844aa725558f0eed5a8e262db9d0cef1fd5d8e8c2d6ab6eef50ac95d2418b0c7a900e048528099b85ab70e4f7db0831fb444b2637e264601e93221af.json
1.7M /root/.agoric/cache/b1-ac10d0dd844aa725558f0eed5a8e262db9d0cef1fd5d8e8c2d6ab6eef50ac95d2418b0c7a900e048528099b85ab70e4f7db0831fb444b2637e264601e93221af.json
+ agd tx swingset install-bundle --compress @/root/.agoric/cache/b1-ac10d0dd844aa725558f0eed5a8e262db9d0cef1fd5d8e8c2d6ab6eef50ac95d2418b0c7a900e048528099b85ab70e4f7db0831fb444b2637e264601e93221af.json --from user1 --keyring-backend=test --gas=auto --chain-id=agoriclocal -bblock --yes -o json
gas estimate: 55635093
{"height":"1380","txhash":"46BBC66E459290829BE98AD3A7B6F4915090A225ED78FE8742060D266AB88474","codespace":"","code":0,"data":"0A230A212F61676F7269632E7377696E677365742E4D7367496E7374616C6C42756E646C65","raw_log":"[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/agoric.swingset.MsgInstallBundle\"}]}]}]","logs":[{"msg_index":0,"log":"","events":[{"type":"message","attributes":[{"key":"action","value":"/agoric.swingset.MsgInstallBundle"}]}]}],"info":"","gas_wanted":"55635093","gas_used":"55632083","tx":null,"timestamp":"","events":[{"type":"tx","attributes":[{"key":"ZmVl","value":"","index":true}]},{"type":"tx","attributes":[{"key":"YWNjX3NlcQ==","value":"YWdvcmljMXhlMjY5eTNmaHllOG5ybGR1ZjgyNndnbjQ5OXk2d21udjMydHc1LzEy","index":true}]},{"type":"tx","attributes":[{"key":"c2lnbmF0dXJl","value":"bGlndURuQ1pmamVTU24yOGplNG9rWVMxbVptQWpWby9UMHBlTUo1Y2VHQm9yT1J4dzFmZEE3VjVpazMzQy9nVkFROWlma0xMUzlmWnNJYlBjZ1Y3U0E9PQ==","index":true}]},{"type":"coin_spent","attributes":[{"key":"c3BlbmRlcg==","value":"YWdvcmljMXhlMjY5eTNmaHllOG5ybGR1ZjgyNndnbjQ5OXk2d21udjMydHc1","index":true},{"key":"YW1vdW50","value":"MzQwNzAwMDAwMHVpc3Q=","index":true}]},{"type":"coin_received","attributes":[{"key":"cmVjZWl2ZXI=","value":"YWdvcmljMWFlMGxtdHpsZ3JjbmxhOXhqa3BhYXJxNWQ1ZGZlejYzaDNudWNs","index":true},{"key":"YW1vdW50","value":"MzQwNzAwMDAwMHVpc3Q=","index":true}]},{"type":"transfer","attributes":[{"key":"cmVjaXBpZW50","value":"YWdvcmljMWFlMGxtdHpsZ3JjbmxhOXhqa3BhYXJxNWQ1ZGZlejYzaDNudWNs","index":true},{"key":"c2VuZGVy","value":"YWdvcmljMXhlMjY5eTNmaHllOG5ybGR1ZjgyNndnbjQ5OXk2d21udjMydHc1","index":true},{"key":"YW1vdW50","value":"MzQwNzAwMDAwMHVpc3Q=","index":true}]},{"type":"message","attributes":[{"key":"c2VuZGVy","value":"YWdvcmljMXhlMjY5eTNmaHllOG5ybGR1ZjgyNndnbjQ5OXk2d21udjMydHc1","index":true}]},{"type":"message","attributes":[{"key":"YWN0aW9u","value":"L2Fnb3JpYy5zd2luZ3NldC5Nc2dJbnN0YWxsQnVuZGxl","index":true}]}]}
+ for b in $(cat bundles/bundle-list)
+ echo installing /root/.agoric/cache/b1-e990fe25bae9b9d4f5c2484c54efbfadbf31e128a89270f8ca518c3cb4fb4ab283f36e838c9f3cfc9df84dff25a4b939ed82e4174d632028ada81ab81bc9d083.json
installing /root/.agoric/cache/b1-e990fe25bae9b9d4f5c2484c54efbfadbf31e128a89270f8ca518c3cb4fb4ab283f36e838c9f3cfc9df84dff25a4b939ed82e4174d632028ada81ab81bc9d083.json
+ install_bundle /root/.agoric/cache/b1-e990fe25bae9b9d4f5c2484c54efbfadbf31e128a89270f8ca518c3cb4fb4ab283f36e838c9f3cfc9df84dff25a4b939ed82e4174d632028ada81ab81bc9d083.json
+ ls -sh /root/.agoric/cache/b1-e990fe25bae9b9d4f5c2484c54efbfadbf31e128a89270f8ca518c3cb4fb4ab283f36e838c9f3cfc9df84dff25a4b939ed82e4174d632028ada81ab81bc9d083.json
5.0M /root/.agoric/cache/b1-e990fe25bae9b9d4f5c2484c54efbfadbf31e128a89270f8ca518c3cb4fb4ab283f36e838c9f3cfc9df84dff25a4b939ed82e4174d632028ada81ab81bc9d083.json
+ agd tx swingset install-bundle --compress @/root/.agoric/cache/b1-e990fe25bae9b9d4f5c2484c54efbfadbf31e128a89270f8ca518c3cb4fb4ab283f36e838c9f3cfc9df84dff25a4b939ed82e4174d632028ada81ab81bc9d083.json --from user1 --keyring-backend=test --gas=auto --chain-id=agoriclocal -bblock --yes -o json
Error: RPC error -32600 - Invalid Request: error reading request body: http: request body too large
Usage:
  agd tx swingset install-bundle <JSON>/@<FILE>/- [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --compress                 Compress the bundle in transit (default true)
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
      --fee-account string       Fee account pays fees for the transaction instead of deducting from the signer
      --fees string              Fees to pay along with transaction; eg: 10uatom
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically (default 200000)
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible)
  -h, --help                     help for install-bundle
      --keyring-backend string   Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os")
      --keyring-dir string       The client Keyring directory; if omitted, the default 'home' directory will be used
      --ledger                   Use a connected Ledger device
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --note string              Note to add a description to the transaction (previously --memo)
      --offline                  Offline mode (does not allow any online functionality
  -o, --output string            Output format (text|json) (default "json")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --sign-mode string         Choose sign mode (direct|amino-json), this is an advanced feature
      --timeout-height uint      Set a block timeout height to prevent the tx from being committed past a certain height
  -y, --yes                      Skip tx broadcasting prompt confirmation

Global Flags:
      --chain-id string     The network chain ID
      --home string         directory for config and data (default "/root/.agoric")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
      --trace               print out full stack trace on errors

make: *** [Makefile:68: install-bundles] Error 1
make: Leaving directory '/workspace/contract'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@dckc
Copy link
Member

dckc commented Jan 2, 2024

Note Agoric/agoric-sdk#8621 (comment)

The many copies in the bundle of, for example, @endo/promise-kit mirror many copies in the node_modules directories.

So the solution is to wrestle with yarn to Don't Do That.

cc @0xpatrickdev

@0xpatrickdev
Copy link
Member

@migueldingli1997 with #34 and #37 I suspect this will be resolved for you. Please take a look when you have a chance and let us know!

@migueldingli1997
Copy link
Author

Yep this is resolved! Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants