o1js: Failed to derive correct actions hash

This issue was previously identified and fixed in this pull request. However, it still appears to persist.

o1js version: 1.8.0

The error can be reproduced using the following script with any of the provided addresses:

const network = Mina.Network({
  mina: 'https://api.minascan.io/node/devnet/v1/graphql',
  archive: 'https://api.minascan.io/archive/devnet/v1/graphql',
});
Mina.setActiveInstance(network);

const actions = await Mina.activeInstance.fetchActions(
  PublicKey.fromBase58(
    'B62qrHzs8Sn6rJW3Jkd8xvUkPKb4RBC4xsTgKnBd7KvVWnjhkXV7YKJ'
    // 'B62qmASMoUYbRA2TwbB6gDTcdaS9QxEQYghV67i8oMeqA5tsbfvkJ6P'
    // 'B62qio1AyjVw6tBqYCuEJqDz3ej3qVCyJjcQfTTbt3VgE6MZmtruiMJ'
  )
);

The order of actions within a single block remains problematic. We have updated the o1js fetch script to attempt different permutations of actions. This approach successfully identifies the correct order of actions, but for blocks with 7 or more actions, it has to check too many permutations.

Additionally, we have not found a logical way to sort the array of actions, and their order seems random for blocks with a broken sequence. The order of actions does not match the order of events, even though they are dispatched within the same function.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (4 by maintainers)

Most upvoted comments

@aii23 I want to add a progress update on this one. Unfortunately, the issue runs pretty deep into the stack. I began work on the fix to the archive node API today. If I’m lucky, there will be a fixed version of that ready for review this week. But after it is ready for review, there may still be some revisions required, and it will need to be released and deployed by the node operator. It’s not the kind of thing that can be quickly resolved.

If you’re interested, I would love your input on what test cases should be added to the archive node. Right now, we reduce some actions in the test suite, but one keypair ever emits any actions. I added a test where 3 different keypairs all emit actions on the same block. If you could give me an idea of how your system actually works and how you’re generating these actions that end up out of order, I can add those types of cases to the test suite.

Thanks for your patience while we work on it. We will do it right this time so that it’s truly fixed.

Sure. ‘B62qrHzs8Sn6rJW3Jkd8xvUkPKb4RBC4xsTgKnBd7KvVWnjhkXV7YKJ’: Error for state 11553781833537412187998791170094246504179739906426596650283148421062134031747 Failed at permutation: [ ‘40612’, ‘40613’, ‘40614’, ‘40615’ ] Right order: [ ‘40613’, ‘40612’, ‘40614’, ‘40615’ ]

‘B62qmASMoUYbRA2TwbB6gDTcdaS9QxEQYghV67i8oMeqA5tsbfvkJ6P’: This account appears to be unaffected by the bug

‘B62qio1AyjVw6tBqYCuEJqDz3ej3qVCyJjcQfTTbt3VgE6MZmtruiMJ’ Error for state 622068088931135211835608923279390386187946637639515815219699650452056633535 Failed at permutation: [ ‘41263’, ‘41264’ ] Right order: [ ‘41264’, ‘41263’ ]

Error for state 13601174010644725465032541467597965984215487137161264129512131433609455661639 Failed at permutation: [ ‘41327’, ‘41328’ ] Right order: [ ‘41328’, ‘41327’ ]

Error for state 24001492778780244006185811344983416316405407346861526263853195607046226805225 Failed at permutation: [ ‘41704’, ‘41705’, ‘41712’, ‘41713’, ‘41714’, ‘41715’ ] Right order: [ ‘41715’, ‘41713’, ‘41705’, ‘41712’, ‘41704’, ‘41714’ ]

Error for state 5355154305568360296397934424492884898082969130147334729446373076991022178134 Failed at permutation: [ ‘41742’, ‘41743’ ] Right order: [ ‘41743’, ‘41742’ ]