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

gas_price field of Contract call looks suspicious in state channels #506

Open
davidyuk opened this issue Jan 24, 2023 · 0 comments
Open

Comments

@davidyuk
Copy link
Member

I've called channels.get.offchain_state method of node and get this encoded call state tree:

cs_+QFBggJuAbkBOvkBNz8B+QEyuJf4lUABuEBRt/rxUTPwSp8BBMQWR70Ag6kTiNXTDmO2LWStsbEXhED9reWbZWfYmFIwTrKG6Khrbb7SvfC4T4ll2BtXsX/luE/4TSkCoQFZYYdOS6IFcvCPFPCBUOkebcCW0ZehLaMRA+K9RcniKwICoQVRt/rxUTPwSp8BBMQWR70Ag6kTiNXTDmO2LWStsbEXhAA9PwDAuJf4lUABuEBRt/rxUTPwSp8BBMQWR70Ag6kTiNXTDmO2LWStsbEXhADlKPCJlyMdCDQrNsajcRCzQk6M8LSJvbdnJ7Lc4aFjuE/4TSkCoQFZYYdOS6IFcvCPFPCBUOkebcCW0ZehLaMRA+K9RcniKwMDoQVRt/rxUTPwSp8BBMQWR70Ag6kTiNXTDmO2LWStsbEXhAEOVADAenqUfg==

Then I unpacked it and got two call entries:

'ba_Ubf68VEz8EqfAQTEFke9AIOpE4jV0w5jti1krbGxF4QA5SjwiZcjHQg0KzbGo3EQs0JOjPC0ib23Zyey3OGhY+BjbKc=': {
  callerId: 'ak_gN7nP72rm7D1kuSYWRtL9Sf4pFRoTPKM8wa9JHyneazW8zHm4',
  callerNonce: 3,
  contractId: 'ct_czPqotjcUujiXu5DaTeJMbv2WJpqwuhsQFn6edrGVRaoHLifk',
  gasPrice: '1',
  gasUsed: 14,
  height: 3,
  log: [],
  returnType: 0,
  returnValue: 'cb_VNLOFXc=',
  version: 2,
},
'ba_Ubf68VEz8EqfAQTEFke9AIOpE4jV0w5jti1krbGxF4RA/a3lm2Vn2JhSME6yhuioa22+0r3wuE+JZdgbV7F/5c9Ms1g=': {
  callerId: 'ak_gN7nP72rm7D1kuSYWRtL9Sf4pFRoTPKM8wa9JHyneazW8zHm4',
  callerNonce: 2,
  contractId: 'ct_czPqotjcUujiXu5DaTeJMbv2WJpqwuhsQFn6edrGVRaoHLifk',
  gasPrice: '0',
  gasUsed: 61,
  height: 2,
  log: [],
  returnType: 0,
  returnValue: 'cb_P4fvHVw=',
  version: 2,
},

In both entries gas_price is lower than a minimum gas price (1e9) and it differs between the similar calls, I assume it was generated on the node side. This field's semantic are probably different in state channels (is it nonce or round?), but I can't find related docs.

In this case contract call entries have version 2, but I can find documentation only for version 1 in https://github.com/aeternity/protocol/blob/c007dee/serializations.md#contract-call.

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

1 participant