warp-contracts / warp

An implementation of the Arweave SmartWeave smart contracts protocol.
MIT License
159 stars 44 forks source link

Seeing different results when reading a contract #331

Closed arcj0 closed 1 year ago

arcj0 commented 1 year ago

As noted on Discord, we're seeing different results when reading the contract: Tb9kKmUqvNw_HnWgroWkRQK8Fa8frxl7CKA3zSsrETc

We're currently on v1.2.47 of warp-contracts.

asiaziola commented 1 year ago

Hey :) Can't find this contract (it's not in SonAR and not in viewblock) so it's hard to debug it... Can you privde any MRE?

arcj0 commented 1 year ago

I'm not sure why, the contract was created using warp. You can read it like this:

import { WarpFactory } from "warp-contracts";

function warpInit(env = "") {
    let warp = {};
    if (env === "") {
        env = import.meta.env.VITE_ENV;
    }
    try {
        // Using Warp
        if (env === "PROD") {
            warp = WarpFactory.forMainnet();
        } else if (env === "TEST") {
            warp = WarpFactory.forTestnet();
        } else if (env === "DEV") {
            warp = WarpFactory.forLocal();
        } else {
            warp = WarpFactory.forTestnet();
        }
    } catch(e) {
        console.log(e);
    }
    return warp;
};

async function warpRead(contractId, internalWrites = true, env = "") {
    const warp = warpInit(env);

    try {
        const contract = warp.contract(contractId)
            .setEvaluationOptions({ 
                internalWrites: internalWrites,
            });
        const result = await contract.readState();
        return result.cachedValue;
    } catch (e) {
        console.log(e);
        return {};
    }
};

async function main() {
    const contractId = "Tb9kKmUqvNw_HnWgroWkRQK8Fa8frxl7CKA3zSsrETc";

    const result = await warpRead(contractId, true, "TEST");
    console.log(JSON.stringify(result));
}

main();
ppedziwiatr commented 1 year ago

A yeah, it's a testnet contract with a bundlr_tx_id = tXUio_FvSp4PfuEwUhrhDMH0Vv7Y9JW59c-M9HeD2mI (https://viewblock.io/arweave/tx/tXUio_FvSp4PfuEwUhrhDMH0Vv7Y9JW59c-M9HeD2mI), we need to fix the search for testnet in SonAR.

And what is the exact issue here? the consecutive state reads (with a cache cleared) result in different results?

arcj0 commented 1 year ago

The issue is that users are seeing different returned states. The easiest way to explain it is that I'm seeing the state.evolve property as one result and another user is seeing it as "", which means the contract didn't evaluate the evolve interaction.

In fact, when I run the script above, I'm seeing the state.evolve property as "". There have been 4 evolve interactions (I think) and the last one was interaction: celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY.

I hope that helps.

asiaziola commented 1 year ago

when exactly do you see the evolve property set to some id? I mean - when you are logged to which wallet address?

ppedziwiatr commented 1 year ago

Hmm, interesting - I'm not seeing the function 'evolve' to be called in any of the currently registered interactions (there are currently 50 interactions for this contract).

The celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY is a call to propose function with params:

{
"function":"propose","type":"evolve","recipient":"","qty":"","key":"","value":"ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA","note":""
}
arcj0 commented 1 year ago

When, I'm logged in to ArConnect as ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk (the creator of the contract), I see the correct results.

Interestingly, when I'm logged in as Fof_-BNkZN_nQp0VsD_A9iGb-Y4zOeFKHA8_GK2ZZ-I, I see the correct results as well.

When I'm not logged in, I don't see all the interactions.

arcj0 commented 1 year ago

Hmm, interesting - I'm not seeing the function 'evolve' to be called in any of the currently registered interactions (there are currently 50 interactions for this contract).

The celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY is a call to propose function with params:

{
"function":"propose","type":"evolve","recipient":"","qty":"","key":"","value":"ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA","note":""
}

This is because it's a multi-sig contract, all interactions are proposed first, then once passed, the interaction is run.

ppedziwiatr commented 1 year ago

So there are no direct calls to evolve, right? just via this propose?

We're not using arconnect, so it's really hard for me to say what is it doing underneath - but I will do some tests locally with this contract.

When it is decided that the proposal has passed/is valid? Based on some block timestamp/height and proposal duration?

What does it mean that the 'interaction is run' - i.e. who exactly is responsible for running it?

Can you please show the exact line of code (using the version from the srcTxId) where the evolve should be set?

We really need some more details - when the evolve should (in theory) show, how exactly does it work - it's hard for us to instantly analyze all the 685 lines of the compiled js code :-)

In the meantime - I'll play around with it locally. If I understand correctly - the expected result is that the evolve should be set in the state? (and if so - than to what value? ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA)?

ppedziwiatr commented 1 year ago

So I've verified the contract state locally, 10 different reads with in memory cache (so reading from scratch each time). Each time I have an empty value in state.evolve.

  1. the first three evolve proposals have failed due to "quorum not being met":
    {
      status: 'quorumFailed',
      type: 'evolve',
      id: '10922331YmhuMoT7_BTzIIIPlmUOajTImNLk7lzxSj82-Up1vI2',
      totalWeight: 2,
      votingPower: [Object],
      yays: 0,
      nays: 0,
      voted: [],
      start: 1092233,
      lockLength: 0,
      voteLength: 2160,
      value: 'drE3xaNRlex47dZZOEAos0t4W_LYU6AlHnQqVgXCAbw',
      note: 'Evolve contract to drE3xaNRlex47dZZOEAos0t4W_LYU6AlHnQqVgXCAbw. Verify the new contract source here. https://aftr.market/latest-contract-source',
      statusNote: "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
    },
{
      status: 'quorumFailed',
      type: 'evolve',
      id: '1099608XHCH5YauvDf7vgcibMgIZJlNm0ahefspHC7l1sR1Hbg2',
      totalWeight: 2,
      votingPower: [Object],
      yays: 0,
      nays: 0,
      voted: [],
      start: 1099608,
      lockLength: 0,
      voteLength: 2160,
      value: 'Y5jbLtKAUZna_If7ec0-LiQrkzMIfXq9dv08ncKJTt0',
      note: 'Evolve contract to Y5jbLtKAUZna_If7ec0-LiQrkzMIfXq9dv08ncKJTt0. Verify the new contract source here. https://aftr.market/latest-contract-source',
      statusNote: "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
    },
{
      status: 'quorumFailed',
      type: 'evolve',
      id: '11001381JmJVnYVBpfIBGsY19diaRJb6tKcsBzHzGE_73HWHU82',
      totalWeight: 2,
      votingPower: [Object],
      yays: 0,
      nays: 0,
      voted: [],
      start: 1100138,
      lockLength: 0,
      voteLength: 2160,
      value: 'ZoWzPJHkGQR6XFIzm5fVcRl8kJBCB-TnydjftvPfrNE',
      note: 'Evolve contract to ZoWzPJHkGQR6XFIzm5fVcRl8kJBCB-TnydjftvPfrNE. Verify the new contract source here. https://aftr.market/latest-contract-source',
      statusNote: "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
    },
  1. The last evolve proposal is still in active status:
    {
      status: 'active',
      type: 'evolve',
      id: '1100752celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY2',
      totalWeight: 2,
      votingPower: [Object],
      yays: 0,
      nays: 0,
      voted: [],
      start: 1100752,
      lockLength: 0,
      voteLength: 2160,
      value: 'ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA',
      note: 'Evolve contract to ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA. Verify the new contract source here. https://aftr.market/latest-contract-source'
    },

If I understand correctly - 'active' status means the the voting period has not yet ended and the decission is not yet made.

For reference - the error messages for the interactions:

{
  ujyTE9JheqFgHpdAd9JMwI0sqxmptAC5j1FijJuQpi8: 'Caller has already voted.',
  sXOSQgMWnwUpxBkHVfZC5TPPTEsRcbXCmppTOieODTY: 'Vote does not exist.',
  oY2TQlPh2bgtUvu1wNPk5bJV_NR33nmN6SvzFeI6Um4: 'Vote does not exist.',
  '-EwySLKtBqLryl1eNyjCQidaza1kDN_WydvSvRZU3mw': "Caller isn't a member of the repo and therefore isn't allowed to vote.",
  '98eTgNsqbX3jtYol6TrHWB51DNORj7b2oZTHDLtoSys': 'Vote does not exist.',
  'AyTl3DhVI0gms4hlGns3AoAFvfDbcBsZSMIe1C9-e7g': 'Vote does not exist.',
  XkQCcXUPBWV45LQum52mmMrwQjFfv6_W8TTAc5TUSpM: 'Vote does not exist.',
  'Ul8hebpzh_Ip-rqID7QYT0uZ9-PxEjXq9sKCWQCkv1s': 'Vote does not exist.',
  k9TFtjVpnFZigcENav2ADm_Ljd7donAPvpyIk_35Lu8: 'Vote does not exist.',
  V1PLguip3xiR_eUhpMg5EKT_XMIFY1Hw9f_uGstCkeM: 'Vote does not exist.',
  DWB2q3WOjgSvE5ePoSB3BFAtggwv18wRd6fZKBM06o8: 'Vote does not exist.',
  hc7BCU3wXEcBQ62xwHUoHNtgFCKExMquvhuFGbK12Pg: 'Vote does not exist.',
  '6-v67JlFl7PddsOCoUJ9mun8hpVRi88sJ_8xgYC59qk': 'Vote does not exist.',
  S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM: 'Vote does not exist.',
  W4US7Xz0GJ8W1USkjg9EXVC_1Pl2cJAqEOZxyWtwv9w: 'Vote does not exist.',
  hwn2NbR8D9P8X2MfOjpS3eCoGWuvOfi5Itrvc8rpfpM: 'Vote does not exist.'
}
arcj0 commented 1 year ago

I'll answer your questions in order:

  1. The evolve property is changed after the proposal is approved in the voting process. The way this works is that because evolve is a state.property, a vote is proposed to change the state.evolve property to another ID. Once approved, state.evolve is set to the new ID.

  2. Dan (on the team) is signed in from another wallet using ArConnect and sees different results from as well. So, it's looking like the issue may not have to do with reading the contract signed in or not.

  3. Every vote has a vote length, so when that length expires, the total is tallied. Also, if a vote achieves support or failure (meaning, no matter what other votes are cast, the result can't change) before the vote expires, the vote will be finalized and the state changed (or not) accordingly.

  4. When I say "Interaction run", I mean a write interaction on the contract.

  5. In the smart contract or on the frontend? In the smart contract, the evolve property is set in the ModifyRepo function

    } else if (vote.type === 'set') {
        if (vote.key.substring(0, 9) === 'settings.') {
            // key is a setting
            let key = getStateProperty(vote.key);
            updateSetting(repo, key, vote.value);
        } else {
            if (vote.key === "owner" && !isProposedOwnershipValid(repo, vote.type, vote.qty, vote.value)) {
                throw new ContractError("The proposed change is not allowed as it would leave the ownership of the repo with no balance thus rendering the repo useless.");
            }
            repo[vote.key] = vote.value;  // <-- HERE
        }
  6. I explained how I'm "evolving" above, does that help?

  7. The latest evolve value should be ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA

arcj0 commented 1 year ago

Yes, you are correct, however, in my view on the frontend, the vote has passed.

arcj0 commented 1 year ago

I might see something... Checking the isProposedOwnershipValid function in the contract.

ppedziwiatr commented 1 year ago

The last interaction with this contract is on block height 1102844. It's the dKMS9J4yP3Hde7CxMT9ttY1qFciyRegJc3JekExbLOY interaction: {"function":"finalize"}

The last vote for 'evolve' have started at block height 1100752 The vote duration is 2160

1102844 - 1100752 = 2092 (which is obviously less than 2160).

=> That's why the last evolve vote is still in active status and therefore the 'evolve' value could not be set yet (having in mind that all previous votes for the 'evolve' have failed).

I'm not an expert here as I'm seeing this code for the first time, but the check whether the vote should be finalized is in the finalizeVotes function, which seems to be called for each interaction with the contract.

ppedziwiatr commented 1 year ago

Also, as a side note - you seem to call 'balance' as an interaction with the contract. An example of such interaction is j0rqb8JT7N1Q1dnSsEll7Pg5gVks_gdHUkxul_zEEGc : {"function":"balance","target":"ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk"}

Please don't do this, as it makes no sense - 'balance' is a 'view' function, which returns a 'result' (not state) and DOES NOT modify the state.

It should be called via the contract.viewState API.

arcj0 commented 1 year ago

Also, as I a side - you seem to call 'balance' as an interaction with the contract. An example of such interaction is j0rqb8JT7N1Q1dnSsEll7Pg5gVks_gdHUkxul_zEEGc : {"function":"balance","target":"ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk"}

Please don't do this, as it makes no sense - 'balance' is a 'view' function, which returns a 'result' (not state) and DOES not modify the state.

It should be called via the contract.viewState API.

Yeah, thx for the comment there. We only had balance in there because that's how it was defined by the first PST contracts. I thought that was strange because it is a read function not a write function as you mention.

arcj0 commented 1 year ago

dKMS9J4yP3Hde7CxMT9ttY1qFciyRegJc3JekExbLOY

This might be a little confusing, but let me try and explain...

The finalize function was added in order to finalize votes that have expired. The frontend calls this function when it sees that votes have expired because the AFTR contract will need another write interaction so that the finalizeVote code runs in the contract. This is only needed if a proposal goes all the way to the end. Many votes can be determined before they expire.

So, the reason that you're seeing all those "finalize" interactions on the contract is because some users see an old version of the state, so their frontend determines that a finalize interaction needs to be run.

The proposal that changed the evolve state would have passed on interaction S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM. I'm betting that you don't see that interaction. It was a casted "Yay" vote by wallet ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk.

Maybe it would help if I show you all the interactions that I see on the frontend. Here they are:

{
  "kZMg7Jcj163RQCKVl63bAurQPmg4_tX51Rgtk7XO4H4": true,
  "UThRyYOrnVWqAbGU37ba-L9eZVruWUkftnCBa-Fgf2U": true,
  "i1anIlL-_g_ctVCnG26TPrSwI0K8wxb2PSTOeBONooQ": true,
  "_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw": true,
  "4t0hG931LjzRLeeZUt-_TFAkUyGJgXxfFQZWuiL-l5U": true,
  "k4tNxGLOVR6AeT4WzU_ldKd_OMTUc-IKowWLqYMecS4": true,
  "85GdTZxuenR6VL8sJS1tNv3r0qdRfuthlrue2wnkM10": true,
  "ujyTE9JheqFgHpdAd9JMwI0sqxmptAC5j1FijJuQpi8": false,
  "oGui9u-LwebQ16OTnKWG0Q0MDw19VAWqZb5_v9uyEzk": true,
  "9VW_d4aEYqwiquCKYZ7d3k1oeW0gyPLmPKdXvIXLocs": true,
  "sXOSQgMWnwUpxBkHVfZC5TPPTEsRcbXCmppTOieODTY": false,
  "oY2TQlPh2bgtUvu1wNPk5bJV_NR33nmN6SvzFeI6Um4": false,
  "-EwySLKtBqLryl1eNyjCQidaza1kDN_WydvSvRZU3mw": false,
  "1YmhuMoT7_BTzIIIPlmUOajTImNLk7lzxSj82-Up1vI": true,
  "98eTgNsqbX3jtYol6TrHWB51DNORj7b2oZTHDLtoSys": false,
  "XBeAaG2QLHYfEMG5dQGlhiMCGOVFiLVSKdHCsaBT68M": true,
  "j0rqb8JT7N1Q1dnSsEll7Pg5gVks_gdHUkxul_zEEGc": true,
  "0WdhiRwZh8e55slQsplEo91FNk0_MytmVzHdEtYUWUw": true,
  "XHCH5YauvDf7vgcibMgIZJlNm0ahefspHC7l1sR1Hbg": true,
  "AyTl3DhVI0gms4hlGns3AoAFvfDbcBsZSMIe1C9-e7g": true,
  "XkQCcXUPBWV45LQum52mmMrwQjFfv6_W8TTAc5TUSpM": true,
  "1JmJVnYVBpfIBGsY19diaRJb6tKcsBzHzGE_73HWHU8": true,
  "Ul8hebpzh_Ip-rqID7QYT0uZ9-PxEjXq9sKCWQCkv1s": true,
  "k9TFtjVpnFZigcENav2ADm_Ljd7donAPvpyIk_35Lu8": true,
  "06cEmH8B_pUVUvWMKyBh6dlZdYhejAuxCIlR9lrNPik": true,
  "mpYV15jE_gTFYqMzNtxbnl0UJ7fJFcfMivFGmYZeeL0": true,
  "V1PLguip3xiR_eUhpMg5EKT_XMIFY1Hw9f_uGstCkeM": true,
  "iYGDq1nYMmmwjkv2y1T8Z9D7dop2igg9Obpd0mVhY2o": true,
  "DWB2q3WOjgSvE5ePoSB3BFAtggwv18wRd6fZKBM06o8": true,
  "Lg2Xkw7HyR2vWhc8itro86y2KPGSFNGW910-y857-DY": true,
  "hc7BCU3wXEcBQ62xwHUoHNtgFCKExMquvhuFGbK12Pg": true,
  "Xo_0KqbEapU5E-k0JU0sobuI8n_qdV_yyRTpGV5e5oc": true,
  "6-v67JlFl7PddsOCoUJ9mun8hpVRi88sJ_8xgYC59qk": true,
  "celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY": true,
  "S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM": true,
  "W4US7Xz0GJ8W1USkjg9EXVC_1Pl2cJAqEOZxyWtwv9w": true,
  "hwn2NbR8D9P8X2MfOjpS3eCoGWuvOfi5Itrvc8rpfpM": true,
  "4UARr19TZw3_EDpZvf2u-edi7IE37v2JlFzuLXNPLAs": true,
  "d4B11O1BUu25lLPLD4PK5A9jXeC4SuxbPkMxG8pcqvw": true,
  "AkAfTY0VJc9nEjOdOJrXhSqL-Nzd12JkaYXU2tV_TWQ": true,
  "MRnEju27Zdk0si4Orf-UULqqoysR66q85Ld2bYbkCFY": true,
  "R3dzGS_fgT0JJEi1CQWKagjKKTVl1e2MtxWiY3kGekM": true,
  "4r3KRIQw9-2ng2uWo3gmSh3TDYv2ZIROQ9_cE6mD3ww": true,
  "LIAWMTkHgBtU_L3tCdVLGdj00-8RcADqQgPhY82rQDI": true,
  "nN8-3AZBXHX2K5w0FFT4w1NlTATleMenRCRw9QDkXxc": true,
  "5vjAWCkSPluZe57_jqoiY_Mb8gIcWVrfZG_uwjOZBbA": true,
  "Mk-r9TIJGPhV1nlRBl-hoID0WVyZYR8cZJvmSrhcm4s": true,
  "Sc7ij0Q6su_AuTH-movVe9H3pgraX5eKaakQ5EiAuvM": true,
  "0hJFxnSlSaVmcTxX9p-859Yn-WECkJhd7JRzoSJQ5TQ": true,
  "dKMS9J4yP3Hde7CxMT9ttY1qFciyRegJc3JekExbLOY": true
}
arcj0 commented 1 year ago

I might see something... Checking the isProposedOwnershipValid function in the contract.

This wasn't an issue. The code doesn't run in this case.

ppedziwiatr commented 1 year ago

The proposal that changed the evolve state would have passed on interaction S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM. I'm betting that you don't see that interaction. It was a casted "Yay" vote by wallet ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk.

Not sure what you mean by 'seeing', but it's within the error messages that I've pasted (so it must have been processed by the SDK): S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM: 'Vote does not exist.',

'ErrorMessages' are in general ContractErrors thrown by the contract during interaction evaluation.

The full interaction is:

{"id": "S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM", "fee": {"winston": "72600854"}, "vrf": null, "tags": [{"name": "App-Name", "value": "SmartWeaveAction"}, {"name": "App-Version", "value": "0.3.0"}, {"name": "SDK", "value": "Warp"}, {"name": "Contract", "value": "Tb9kKmUqvNw_HnWgroWkRQK8Fa8frxl7CKA3zSsrETc"}, {"name": "Input", "value": "{\"function\":\"vote\",\"voteId\":\"1100752celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY0\",\"cast\":\"yay\"}"}, {"name": "Warp-Testnet", "value": "1.0.0"}, {"name": "Signing-Client", "value": "ArConnect"}, {"name": "Signing-Client-Version", "value": "0.5.2"}], "block": {"id": "3xkacldx3KguHmvKpIyNFHKm4OzH01xygun3iYvJJedOLjR4n9isBKqdo3Ug_Q6u", "height": 1100752, "timestamp": 1674050465}, "owner": {"address": "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk"}, "source": "redstone-sequencer", "sortKey": "000001100752,1674050548685,dd733a9e9ae71767d40d8b319769a76514af18930fdf5e0881b71a3440d86784", "testnet": "1.0.0", "quantity": {"winston": "0"}, "recipient": "", "lastSortKey": "000001100752,1674050533295,5da57f7dbb7018952d75613134e43ce61b5113def7683ad56cb7307015b2c6b1"}

The list of all (at the time of writing) interactions, sorted by the sort-key, is:

kZMg7Jcj163RQCKVl63bAurQPmg4_tX51Rgtk7XO4H4
UThRyYOrnVWqAbGU37ba-L9eZVruWUkftnCBa-Fgf2U
i1anIlL-_g_ctVCnG26TPrSwI0K8wxb2PSTOeBONooQ
_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw
4t0hG931LjzRLeeZUt-_TFAkUyGJgXxfFQZWuiL-l5U
k4tNxGLOVR6AeT4WzU_ldKd_OMTUc-IKowWLqYMecS4
85GdTZxuenR6VL8sJS1tNv3r0qdRfuthlrue2wnkM10
ujyTE9JheqFgHpdAd9JMwI0sqxmptAC5j1FijJuQpi8
oGui9u-LwebQ16OTnKWG0Q0MDw19VAWqZb5_v9uyEzk
9VW_d4aEYqwiquCKYZ7d3k1oeW0gyPLmPKdXvIXLocs
sXOSQgMWnwUpxBkHVfZC5TPPTEsRcbXCmppTOieODTY
oY2TQlPh2bgtUvu1wNPk5bJV_NR33nmN6SvzFeI6Um4
-EwySLKtBqLryl1eNyjCQidaza1kDN_WydvSvRZU3mw
1YmhuMoT7_BTzIIIPlmUOajTImNLk7lzxSj82-Up1vI
98eTgNsqbX3jtYol6TrHWB51DNORj7b2oZTHDLtoSys
XBeAaG2QLHYfEMG5dQGlhiMCGOVFiLVSKdHCsaBT68M
j0rqb8JT7N1Q1dnSsEll7Pg5gVks_gdHUkxul_zEEGc
0WdhiRwZh8e55slQsplEo91FNk0_MytmVzHdEtYUWUw
XHCH5YauvDf7vgcibMgIZJlNm0ahefspHC7l1sR1Hbg
AyTl3DhVI0gms4hlGns3AoAFvfDbcBsZSMIe1C9-e7g
XkQCcXUPBWV45LQum52mmMrwQjFfv6_W8TTAc5TUSpM
1JmJVnYVBpfIBGsY19diaRJb6tKcsBzHzGE_73HWHU8
Ul8hebpzh_Ip-rqID7QYT0uZ9-PxEjXq9sKCWQCkv1s
k9TFtjVpnFZigcENav2ADm_Ljd7donAPvpyIk_35Lu8
06cEmH8B_pUVUvWMKyBh6dlZdYhejAuxCIlR9lrNPik
mpYV15jE_gTFYqMzNtxbnl0UJ7fJFcfMivFGmYZeeL0
V1PLguip3xiR_eUhpMg5EKT_XMIFY1Hw9f_uGstCkeM
iYGDq1nYMmmwjkv2y1T8Z9D7dop2igg9Obpd0mVhY2o
DWB2q3WOjgSvE5ePoSB3BFAtggwv18wRd6fZKBM06o8
Lg2Xkw7HyR2vWhc8itro86y2KPGSFNGW910-y857-DY
hc7BCU3wXEcBQ62xwHUoHNtgFCKExMquvhuFGbK12Pg
Xo_0KqbEapU5E-k0JU0sobuI8n_qdV_yyRTpGV5e5oc
6-v67JlFl7PddsOCoUJ9mun8hpVRi88sJ_8xgYC59qk
celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY
S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM
W4US7Xz0GJ8W1USkjg9EXVC_1Pl2cJAqEOZxyWtwv9w
hwn2NbR8D9P8X2MfOjpS3eCoGWuvOfi5Itrvc8rpfpM
4UARr19TZw3_EDpZvf2u-edi7IE37v2JlFzuLXNPLAs
d4B11O1BUu25lLPLD4PK5A9jXeC4SuxbPkMxG8pcqvw
AkAfTY0VJc9nEjOdOJrXhSqL-Nzd12JkaYXU2tV_TWQ
MRnEju27Zdk0si4Orf-UULqqoysR66q85Ld2bYbkCFY
R3dzGS_fgT0JJEi1CQWKagjKKTVl1e2MtxWiY3kGekM
4r3KRIQw9-2ng2uWo3gmSh3TDYv2ZIROQ9_cE6mD3ww
LIAWMTkHgBtU_L3tCdVLGdj00-8RcADqQgPhY82rQDI
nN8-3AZBXHX2K5w0FFT4w1NlTATleMenRCRw9QDkXxc
5vjAWCkSPluZe57_jqoiY_Mb8gIcWVrfZG_uwjOZBbA
Mk-r9TIJGPhV1nlRBl-hoID0WVyZYR8cZJvmSrhcm4s
Sc7ij0Q6su_AuTH-movVe9H3pgraX5eKaakQ5EiAuvM
0hJFxnSlSaVmcTxX9p-859Yn-WECkJhd7JRzoSJQ5TQ
dKMS9J4yP3Hde7CxMT9ttY1qFciyRegJc3JekExbLOY

And again - from the perspective of the (currently) last interaction with this contract (dKMS9J4yP3Hde7CxMT9ttY1qFciyRegJc3JekExbLOY) - the last vote for the evolve has not yet ended - for the reasons I've explained in my previous message.

I will try to analyze this further tomorrow, but - as of now - I don't see any issues in the SDK itself. I've run the state evaluation 10 more times, each time on a fresh cache, each time I get the same result (no evolve is set). Each time the first 3 proposal do fail, and last is not yet ended.

I really would like to put any frontend/arconnect stuff out of the equation.

ppedziwiatr commented 1 year ago

It would be great if you could prepare a full MRE (like in the case when you've had a missing 'await' in the contract or when the result from the internal write was not used correctly). Otherwise it might be really difficult for us to find the potential root cause of your issues...

arcj0 commented 1 year ago

I'll be happy to put together an MRE, but I'm not seeing the updated contract using node, BUT I am on the web. In fact, I can produce 2 different states when testing using the frontend. The web frontend uses WarpFactory in warp-contracts/web and node uses WarpFactory in warp-contracts. Could there be a difference there?

To reproduce on the web, I get the old version of the state (the one you see) if I use incognito mode, but I get the new version of the state if I'm connected via any Arconnect wallet. I'm not sure how this makes a difference b/c wallet is not needed in a read contract. Does caller come into play during a read? I don't see how it could, but that's seems to be the only difference.

I was thinking maybe there's a contract bug where there's an indeterminate result, but I'd think that I'd be able to see different results if I ran it several times in a row. My wallet(s) (connected using Arconnect in the app) always return the expected result. A disconnected wallet always returns the old state. Different browsers have the same effect. Also note that 2 members on our team get different results, so it's not just my wallets.

Again, I haven't been able to see the latest state using node, only the web. Any suggestions on what you might need to help troubleshoot? I know that's going to be hard if you don't ever see the results I see.

ppedziwiatr commented 1 year ago

A wallet does not affect how the state is evaluated.

Have you tried removing the cache (from the indexeddb

image

)

and evaluate it again?

But - in general - I would like to determine what is the expected result.

What does it mean "old verison of the state" and "new version of the state"? - the one that I see in node.js was the version evaluated from 50 interactions - that - at the time of evaluation - were the only interactions registered with this contract.

I'm attaching the state evaluated on my side and the validity report.

This is the latest - current state of the contract.

And as I've mentioned before - the first three votes for the evolve failed because the quorumFailed error.

The last one has not yet ended (from the perspective of the last interaction with the contract)

{
  "state": {
    "name": "Bravo Team",
    "owner": "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
    "vault": {},
    "votes": [
      {
        "status": "passed",
        "type": "addMember",
        "id": "1091544kZMg7Jcj163RQCKVl63bAurQPmg4_tX51Rgtk7XO4H40",
        "totalWeight": 1,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091544,
        "lockLength": 0,
        "voteLength": 0,
        "recipient": "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA",
        "qty": 1,
        "note": "Add new member, uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA, with a balance of 1",
        "statusNote": "Single owner, no vote required."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1091546UThRyYOrnVWqAbGU37ba-L9eZVruWUkftnCBa-Fgf2U0",
        "totalWeight": 1,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091546,
        "lockLength": 0,
        "voteLength": 0,
        "key": "settings.support",
        "value": 0.51,
        "note": "Change support from 0.5 to 0.51",
        "statusNote": "Single owner, no vote required."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1091547i1anIlL-_g_ctVCnG26TPrSwI0K8wxb2PSTOeBONooQ0",
        "totalWeight": 1,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091547,
        "lockLength": 0,
        "voteLength": 0,
        "key": "ownership",
        "value": "multi",
        "note": "Change ownership from single to multi",
        "statusNote": "Single owner, no vote required."
      },
      {
        "status": "active",
        "type": "set",
        "id": "1091547_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw1",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 1,
        "nays": 1,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1091547,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "desc",
        "value": "A repo to hold Bravo artifacts on-chain.",
        "note": "Change desc from undefined to A repo to hold Bravo artifacts on-chain."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1091547_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 2,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1091547,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.communityLogo",
        "value": "L0EBm-bn-Ck-5Mc98yFcuAAhk0Ds_ilNKrU4QnCl8wA",
        "note": "Change communityLogo from  to L0EBm-bn-Ck-5Mc98yFcuAAhk0Ds_ilNKrU4QnCl8wA",
        "statusNote": "Total Support achieved before vote length timeline."
      },
      {
        "status": "quorumFailed",
        "type": "addMember",
        "id": "10915529VW_d4aEYqwiquCKYZ7d3k1oeW0gyPLmPKdXvIXLocs2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091552,
        "lockLength": 0,
        "voteLength": 2160,
        "recipient": "qIvAbyxsSDnfmLHgRjD1i0jvoLkLFeh_jYFCt_IjdUI",
        "qty": 1,
        "note": "Add new member, qIvAbyxsSDnfmLHgRjD1i0jvoLkLFeh_jYFCt_IjdUI, with a balance of 1",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "evolve",
        "id": "10922331YmhuMoT7_BTzIIIPlmUOajTImNLk7lzxSj82-Up1vI2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1092233,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "drE3xaNRlex47dZZOEAos0t4W_LYU6AlHnQqVgXCAbw",
        "note": "Evolve contract to drE3xaNRlex47dZZOEAos0t4W_LYU6AlHnQqVgXCAbw. Verify the new contract source here. https://aftr.market/latest-contract-source",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "1094324XBeAaG2QLHYfEMG5dQGlhiMCGOVFiLVSKdHCsaBT68M2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1094324,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.support",
        "value": 0.52,
        "note": "Change support from 0.51 to 0.52",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "evolve",
        "id": "1099608XHCH5YauvDf7vgcibMgIZJlNm0ahefspHC7l1sR1Hbg2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1099608,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "Y5jbLtKAUZna_If7ec0-LiQrkzMIfXq9dv08ncKJTt0",
        "note": "Evolve contract to Y5jbLtKAUZna_If7ec0-LiQrkzMIfXq9dv08ncKJTt0. Verify the new contract source here. https://aftr.market/latest-contract-source",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "evolve",
        "id": "11001381JmJVnYVBpfIBGsY19diaRJb6tKcsBzHzGE_73HWHU82",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100138,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "ZoWzPJHkGQR6XFIzm5fVcRl8kJBCB-TnydjftvPfrNE",
        "note": "Evolve contract to ZoWzPJHkGQR6XFIzm5fVcRl8kJBCB-TnydjftvPfrNE. Verify the new contract source here. https://aftr.market/latest-contract-source",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "1100201mpYV15jE_gTFYqMzNtxbnl0UJ7fJFcfMivFGmYZeeL02",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100201,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.voteLength",
        "value": 1,
        "note": "Change voteLength from 2160 to 1",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "1100252iYGDq1nYMmmwjkv2y1T8Z9D7dop2igg9Obpd0mVhY2o2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100252,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "desc",
        "value": "Bravo Team's pooled assets.",
        "note": "Change desc from undefined to Bravo Team's pooled assets.",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "1100253Lg2Xkw7HyR2vWhc8itro86y2KPGSFNGW910-y857-DY2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100253,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "ticker",
        "value": "B",
        "note": "Change ticker from BRAVO to B",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "1100256Xo_0KqbEapU5E-k0JU0sobuI8n_qdV_yyRTpGV5e5oc2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100256,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.customSetting",
        "value": "11",
        "note": "Change customSetting from undefined to 11",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "active",
        "type": "evolve",
        "id": "1100752celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100752,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA",
        "note": "Evolve contract to ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA. Verify the new contract source here. https://aftr.market/latest-contract-source"
      },
      {
        "status": "active",
        "type": "set",
        "id": "11007534UARr19TZw3_EDpZvf2u-edi7IE37v2JlFzuLXNPLAs2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100753,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.settingABC",
        "value": "ABC",
        "note": "Change settingABC from undefined to ABC"
      },
      {
        "status": "active",
        "type": "set",
        "id": "1100812AkAfTY0VJc9nEjOdOJrXhSqL-Nzd12JkaYXU2tV_TWQ2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100812,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.customTest",
        "value": "TEST",
        "note": "Change customTest from undefined to TEST"
      }
    ],
    "claims": [],
    "evolve": "",
    "status": "started",
    "ticker": "BRAVO",
    "tokens": [
      {
        "txID": "YXGW6xaAUa8D_vKgLyExCvth9yceuKL5007dwFgYmeg",
        "tokenId": "Wgkj_tFAZKQh-2Ke6_sOixSxTKOXukmdrcP9zd_PEwA",
        "source": "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
        "balance": 90,
        "start": 1099092,
        "name": "Play Token",
        "ticker": "PLAY",
        "logo": "Cwz6dyp29TiBC2sk8D3YovTfjcrJVZuLb-rdXJ84uXE",
        "lockLength": 0
      }
    ],
    "balances": {
      "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
      "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
    },
    "settings": [
      [
        "quorum",
        0.5
      ],
      [
        "support",
        0.51
      ],
      [
        "voteLength",
        2160
      ],
      [
        "communityLogo",
        "L0EBm-bn-Ck-5Mc98yFcuAAhk0Ds_ilNKrU4QnCl8wA"
      ]
    ],
    "claimable": [],
    "ownership": "multi",
    "votingSystem": "weighted"
  },
  "validity": {
    "kZMg7Jcj163RQCKVl63bAurQPmg4_tX51Rgtk7XO4H4": true,
    "UThRyYOrnVWqAbGU37ba-L9eZVruWUkftnCBa-Fgf2U": true,
    "i1anIlL-_g_ctVCnG26TPrSwI0K8wxb2PSTOeBONooQ": true,
    "_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw": true,
    "4t0hG931LjzRLeeZUt-_TFAkUyGJgXxfFQZWuiL-l5U": true,
    "k4tNxGLOVR6AeT4WzU_ldKd_OMTUc-IKowWLqYMecS4": true,
    "85GdTZxuenR6VL8sJS1tNv3r0qdRfuthlrue2wnkM10": true,
    "ujyTE9JheqFgHpdAd9JMwI0sqxmptAC5j1FijJuQpi8": false,
    "oGui9u-LwebQ16OTnKWG0Q0MDw19VAWqZb5_v9uyEzk": true,
    "9VW_d4aEYqwiquCKYZ7d3k1oeW0gyPLmPKdXvIXLocs": true,
    "sXOSQgMWnwUpxBkHVfZC5TPPTEsRcbXCmppTOieODTY": false,
    "oY2TQlPh2bgtUvu1wNPk5bJV_NR33nmN6SvzFeI6Um4": false,
    "-EwySLKtBqLryl1eNyjCQidaza1kDN_WydvSvRZU3mw": false,
    "1YmhuMoT7_BTzIIIPlmUOajTImNLk7lzxSj82-Up1vI": true,
    "98eTgNsqbX3jtYol6TrHWB51DNORj7b2oZTHDLtoSys": false,
    "XBeAaG2QLHYfEMG5dQGlhiMCGOVFiLVSKdHCsaBT68M": true,
    "j0rqb8JT7N1Q1dnSsEll7Pg5gVks_gdHUkxul_zEEGc": true,
    "0WdhiRwZh8e55slQsplEo91FNk0_MytmVzHdEtYUWUw": true,
    "XHCH5YauvDf7vgcibMgIZJlNm0ahefspHC7l1sR1Hbg": true,
    "AyTl3DhVI0gms4hlGns3AoAFvfDbcBsZSMIe1C9-e7g": false,
    "XkQCcXUPBWV45LQum52mmMrwQjFfv6_W8TTAc5TUSpM": false,
    "1JmJVnYVBpfIBGsY19diaRJb6tKcsBzHzGE_73HWHU8": true,
    "Ul8hebpzh_Ip-rqID7QYT0uZ9-PxEjXq9sKCWQCkv1s": false,
    "k9TFtjVpnFZigcENav2ADm_Ljd7donAPvpyIk_35Lu8": false,
    "06cEmH8B_pUVUvWMKyBh6dlZdYhejAuxCIlR9lrNPik": true,
    "mpYV15jE_gTFYqMzNtxbnl0UJ7fJFcfMivFGmYZeeL0": true,
    "V1PLguip3xiR_eUhpMg5EKT_XMIFY1Hw9f_uGstCkeM": false,
    "iYGDq1nYMmmwjkv2y1T8Z9D7dop2igg9Obpd0mVhY2o": true,
    "DWB2q3WOjgSvE5ePoSB3BFAtggwv18wRd6fZKBM06o8": false,
    "Lg2Xkw7HyR2vWhc8itro86y2KPGSFNGW910-y857-DY": true,
    "hc7BCU3wXEcBQ62xwHUoHNtgFCKExMquvhuFGbK12Pg": false,
    "Xo_0KqbEapU5E-k0JU0sobuI8n_qdV_yyRTpGV5e5oc": true,
    "6-v67JlFl7PddsOCoUJ9mun8hpVRi88sJ_8xgYC59qk": false,
    "celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY": true,
    "S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM": false,
    "W4US7Xz0GJ8W1USkjg9EXVC_1Pl2cJAqEOZxyWtwv9w": false,
    "hwn2NbR8D9P8X2MfOjpS3eCoGWuvOfi5Itrvc8rpfpM": false,
    "4UARr19TZw3_EDpZvf2u-edi7IE37v2JlFzuLXNPLAs": true,
    "d4B11O1BUu25lLPLD4PK5A9jXeC4SuxbPkMxG8pcqvw": true,
    "AkAfTY0VJc9nEjOdOJrXhSqL-Nzd12JkaYXU2tV_TWQ": true,
    "MRnEju27Zdk0si4Orf-UULqqoysR66q85Ld2bYbkCFY": true,
    "R3dzGS_fgT0JJEi1CQWKagjKKTVl1e2MtxWiY3kGekM": true,
    "4r3KRIQw9-2ng2uWo3gmSh3TDYv2ZIROQ9_cE6mD3ww": true,
    "LIAWMTkHgBtU_L3tCdVLGdj00-8RcADqQgPhY82rQDI": true,
    "nN8-3AZBXHX2K5w0FFT4w1NlTATleMenRCRw9QDkXxc": true,
    "5vjAWCkSPluZe57_jqoiY_Mb8gIcWVrfZG_uwjOZBbA": true,
    "Mk-r9TIJGPhV1nlRBl-hoID0WVyZYR8cZJvmSrhcm4s": true,
    "Sc7ij0Q6su_AuTH-movVe9H3pgraX5eKaakQ5EiAuvM": true,
    "0hJFxnSlSaVmcTxX9p-859Yn-WECkJhd7JRzoSJQ5TQ": true,
    "dKMS9J4yP3Hde7CxMT9ttY1qFciyRegJc3JekExbLOY": true
  },
  "errorMessages": {
    "ujyTE9JheqFgHpdAd9JMwI0sqxmptAC5j1FijJuQpi8": "Caller has already voted.",
    "sXOSQgMWnwUpxBkHVfZC5TPPTEsRcbXCmppTOieODTY": "Vote does not exist.",
    "oY2TQlPh2bgtUvu1wNPk5bJV_NR33nmN6SvzFeI6Um4": "Vote does not exist.",
    "-EwySLKtBqLryl1eNyjCQidaza1kDN_WydvSvRZU3mw": "Caller isn't a member of the repo and therefore isn't allowed to vote.",
    "98eTgNsqbX3jtYol6TrHWB51DNORj7b2oZTHDLtoSys": "Vote does not exist.",
    "AyTl3DhVI0gms4hlGns3AoAFvfDbcBsZSMIe1C9-e7g": "Vote does not exist.",
    "XkQCcXUPBWV45LQum52mmMrwQjFfv6_W8TTAc5TUSpM": "Vote does not exist.",
    "Ul8hebpzh_Ip-rqID7QYT0uZ9-PxEjXq9sKCWQCkv1s": "Vote does not exist.",
    "k9TFtjVpnFZigcENav2ADm_Ljd7donAPvpyIk_35Lu8": "Vote does not exist.",
    "V1PLguip3xiR_eUhpMg5EKT_XMIFY1Hw9f_uGstCkeM": "Vote does not exist.",
    "DWB2q3WOjgSvE5ePoSB3BFAtggwv18wRd6fZKBM06o8": "Vote does not exist.",
    "hc7BCU3wXEcBQ62xwHUoHNtgFCKExMquvhuFGbK12Pg": "Vote does not exist.",
    "6-v67JlFl7PddsOCoUJ9mun8hpVRi88sJ_8xgYC59qk": "Vote does not exist.",
    "S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM": "Vote does not exist.",
    "W4US7Xz0GJ8W1USkjg9EXVC_1Pl2cJAqEOZxyWtwv9w": "Vote does not exist.",
    "hwn2NbR8D9P8X2MfOjpS3eCoGWuvOfi5Itrvc8rpfpM": "Vote does not exist."
  }
}
arcj0 commented 1 year ago

First off, I appreciate you taking the time to do this, so thank you!

When I say the "old version" of the contract I mean the contract that hasn't evolved (i.e. the contract that you see and have posted above). The version I see (as well as another team member) on our frontend is different. The easiest way to see the difference is simply looking at the evolve property. You see it as "", and I see it as the most recent contractId. Here's the version of the state that I see:

{
  "state": {
    "name": "Bravo Team",
    "owner": "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
    "vault": {},
    "votes": [
      {
        "status": "passed",
        "type": "addMember",
        "id": "1091544kZMg7Jcj163RQCKVl63bAurQPmg4_tX51Rgtk7XO4H40",
        "totalWeight": 1,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091544,
        "lockLength": 0,
        "voteLength": 0,
        "recipient": "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA",
        "qty": 1,
        "note": "Add new member, uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA, with a balance of 1",
        "statusNote": "Single owner, no vote required."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1091546UThRyYOrnVWqAbGU37ba-L9eZVruWUkftnCBa-Fgf2U0",
        "totalWeight": 1,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091546,
        "lockLength": 0,
        "voteLength": 0,
        "key": "settings.support",
        "value": 0.51,
        "note": "Change support from 0.5 to 0.51",
        "statusNote": "Single owner, no vote required."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1091547i1anIlL-_g_ctVCnG26TPrSwI0K8wxb2PSTOeBONooQ0",
        "totalWeight": 1,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091547,
        "lockLength": 0,
        "voteLength": 0,
        "key": "ownership",
        "value": "multi",
        "note": "Change ownership from single to multi",
        "statusNote": "Single owner, no vote required."
      },
      {
        "status": "failed",
        "type": "set",
        "id": "1091547_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw1",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 1,
        "nays": 1,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1091547,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "desc",
        "value": "A repo to hold Bravo artifacts on-chain.",
        "note": "Change desc from undefined to A repo to hold Bravo artifacts on-chain.",
        "statusNote": "The proposal failed due to lack of support. The proposal's support was 0.5."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1091547_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 2,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1091547,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.communityLogo",
        "value": "L0EBm-bn-Ck-5Mc98yFcuAAhk0Ds_ilNKrU4QnCl8wA",
        "note": "Change communityLogo from  to L0EBm-bn-Ck-5Mc98yFcuAAhk0Ds_ilNKrU4QnCl8wA",
        "statusNote": "Total Support achieved before vote length timeline."
      },
      {
        "status": "quorumFailed",
        "type": "addMember",
        "id": "10915529VW_d4aEYqwiquCKYZ7d3k1oeW0gyPLmPKdXvIXLocs2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1091552,
        "lockLength": 0,
        "voteLength": 2160,
        "recipient": "qIvAbyxsSDnfmLHgRjD1i0jvoLkLFeh_jYFCt_IjdUI",
        "qty": 1,
        "note": "Add new member, qIvAbyxsSDnfmLHgRjD1i0jvoLkLFeh_jYFCt_IjdUI, with a balance of 1",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "evolve",
        "id": "10922331YmhuMoT7_BTzIIIPlmUOajTImNLk7lzxSj82-Up1vI2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1092233,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "drE3xaNRlex47dZZOEAos0t4W_LYU6AlHnQqVgXCAbw",
        "note": "Evolve contract to drE3xaNRlex47dZZOEAos0t4W_LYU6AlHnQqVgXCAbw. Verify the new contract source here. https://aftr.market/latest-contract-source",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "1094324XBeAaG2QLHYfEMG5dQGlhiMCGOVFiLVSKdHCsaBT68M2",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1094324,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.support",
        "value": 0.52,
        "note": "Change support from 0.51 to 0.52",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0"
      },
      {
        "status": "passed",
        "type": "evolve",
        "id": "1099608XHCH5YauvDf7vgcibMgIZJlNm0ahefspHC7l1sR1Hbg0",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 2,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1099608,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "Y5jbLtKAUZna_If7ec0-LiQrkzMIfXq9dv08ncKJTt0",
        "note": "Evolve contract to Y5jbLtKAUZna_If7ec0-LiQrkzMIfXq9dv08ncKJTt0. Verify the new contract source here. https://aftr.market/latest-contract-source",
        "statusNote": "Total Support achieved before vote length timeline."
      },
      {
        "status": "passed",
        "type": "evolve",
        "id": "11001381JmJVnYVBpfIBGsY19diaRJb6tKcsBzHzGE_73HWHU80",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 2,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1100138,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "ZoWzPJHkGQR6XFIzm5fVcRl8kJBCB-TnydjftvPfrNE",
        "note": "Evolve contract to ZoWzPJHkGQR6XFIzm5fVcRl8kJBCB-TnydjftvPfrNE. Verify the new contract source here. https://aftr.market/latest-contract-source",
        "statusNote": "Total Support achieved before vote length timeline."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1100201mpYV15jE_gTFYqMzNtxbnl0UJ7fJFcfMivFGmYZeeL00",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 2,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1100201,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.voteLength",
        "value": 1,
        "note": "Change voteLength from 2160 to 1",
        "statusNote": "Total Support achieved before vote length timeline."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1100252iYGDq1nYMmmwjkv2y1T8Z9D7dop2igg9Obpd0mVhY2o0",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 1,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk"
        ],
        "start": 1100252,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "desc",
        "value": "Bravo Team's pooled assets.",
        "note": "Change desc from undefined to Bravo Team's pooled assets.",
        "statusNote": "The proposal passed with 1 support of a 0.5 quorum."
      },
      {
        "status": "failed",
        "type": "set",
        "id": "1100253Lg2Xkw7HyR2vWhc8itro86y2KPGSFNGW910-y857-DY0",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 1,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk"
        ],
        "start": 1100253,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "ticker",
        "value": "B",
        "note": "Change ticker from BRAVO to B",
        "statusNote": "The proposal failed due to lack of support. The proposal's support was 0."
      },
      {
        "status": "passed",
        "type": "set",
        "id": "1100256Xo_0KqbEapU5E-k0JU0sobuI8n_qdV_yyRTpGV5e5oc0",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 1,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk"
        ],
        "start": 1100256,
        "lockLength": 0,
        "voteLength": 2160,
        "key": "settings.customSetting",
        "value": "11",
        "note": "Change customSetting from undefined to 11",
        "statusNote": "The proposal passed with 1 support of a 0.5 quorum."
      },
      {
        "status": "passed",
        "type": "evolve",
        "id": "1100752celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY0",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 2,
        "nays": 0,
        "voted": [
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA"
        ],
        "start": 1100752,
        "lockLength": 0,
        "voteLength": 2160,
        "value": "ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA",
        "note": "Evolve contract to ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA. Verify the new contract source here. https://aftr.market/latest-contract-source",
        "statusNote": "Total Support achieved before vote length timeline."
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "11007534UARr19TZw3_EDpZvf2u-edi7IE37v2JlFzuLXNPLAs0",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100753,
        "lockLength": 0,
        "voteLength": 1,
        "key": "settings.settingABC",
        "value": "ABC",
        "note": "Change settingABC from undefined to ABC",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0."
      },
      {
        "status": "quorumFailed",
        "type": "set",
        "id": "1100812AkAfTY0VJc9nEjOdOJrXhSqL-Nzd12JkaYXU2tV_TWQ0",
        "totalWeight": 2,
        "votingPower": {
          "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
          "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
        },
        "yays": 0,
        "nays": 0,
        "voted": [],
        "start": 1100812,
        "lockLength": 0,
        "voteLength": 1,
        "key": "settings.customTest",
        "value": "TEST",
        "note": "Change customTest from undefined to TEST",
        "statusNote": "The proposal failed due to the Quorum not being met. The proposal's quorum was 0."
      }
    ],
    "claims": [],
    "evolve": "ZltjnWSiHr04ETayUyJivkUAMTHBYbgo3C6BnwNsHmA",
    "status": "started",
    "ticker": "BRAVO",
    "tokens": [
      {
        "txID": "YXGW6xaAUa8D_vKgLyExCvth9yceuKL5007dwFgYmeg",
        "tokenId": "Wgkj_tFAZKQh-2Ke6_sOixSxTKOXukmdrcP9zd_PEwA",
        "source": "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk",
        "balance": 90,
        "start": 1099092,
        "name": "Play Token",
        "ticker": "PLAY",
        "logo": "Cwz6dyp29TiBC2sk8D3YovTfjcrJVZuLb-rdXJ84uXE",
        "lockLength": 0
      }
    ],
    "balances": {
      "ewTkY6Mytg6C0AtYU6QlkEg1oH-9J2PPS0CM83RL9rk": 1,
      "uWFatpjMyqxa3kGIuI3r02lxQ5tH22cXgadqj-5YJBA": 1
    },
    "settings": [
      [
        "quorum",
        0.5
      ],
      [
        "support",
        0.51
      ],
      [
        "voteLength",
        1
      ],
      [
        "communityLogo",
        "L0EBm-bn-Ck-5Mc98yFcuAAhk0Ds_ilNKrU4QnCl8wA"
      ],
      [
        "customSetting",
        "11"
      ]
    ],
    "claimable": [],
    "ownership": "multi",
    "votingSystem": "weighted",
    "desc": "Bravo Team's pooled assets."
  },
  "validity": {
    "kZMg7Jcj163RQCKVl63bAurQPmg4_tX51Rgtk7XO4H4": true,
    "UThRyYOrnVWqAbGU37ba-L9eZVruWUkftnCBa-Fgf2U": true,
    "i1anIlL-_g_ctVCnG26TPrSwI0K8wxb2PSTOeBONooQ": true,
    "_z_TTLvHio3Zyg8h3tOvods4gXHNVOmr9k-m5psi8Uw": true,
    "4t0hG931LjzRLeeZUt-_TFAkUyGJgXxfFQZWuiL-l5U": true,
    "k4tNxGLOVR6AeT4WzU_ldKd_OMTUc-IKowWLqYMecS4": true,
    "85GdTZxuenR6VL8sJS1tNv3r0qdRfuthlrue2wnkM10": true,
    "ujyTE9JheqFgHpdAd9JMwI0sqxmptAC5j1FijJuQpi8": false,
    "oGui9u-LwebQ16OTnKWG0Q0MDw19VAWqZb5_v9uyEzk": true,
    "9VW_d4aEYqwiquCKYZ7d3k1oeW0gyPLmPKdXvIXLocs": true,
    "sXOSQgMWnwUpxBkHVfZC5TPPTEsRcbXCmppTOieODTY": false,
    "oY2TQlPh2bgtUvu1wNPk5bJV_NR33nmN6SvzFeI6Um4": false,
    "-EwySLKtBqLryl1eNyjCQidaza1kDN_WydvSvRZU3mw": false,
    "1YmhuMoT7_BTzIIIPlmUOajTImNLk7lzxSj82-Up1vI": true,
    "98eTgNsqbX3jtYol6TrHWB51DNORj7b2oZTHDLtoSys": false,
    "XBeAaG2QLHYfEMG5dQGlhiMCGOVFiLVSKdHCsaBT68M": true,
    "j0rqb8JT7N1Q1dnSsEll7Pg5gVks_gdHUkxul_zEEGc": true,
    "0WdhiRwZh8e55slQsplEo91FNk0_MytmVzHdEtYUWUw": true,
    "XHCH5YauvDf7vgcibMgIZJlNm0ahefspHC7l1sR1Hbg": true,
    "AyTl3DhVI0gms4hlGns3AoAFvfDbcBsZSMIe1C9-e7g": true,
    "XkQCcXUPBWV45LQum52mmMrwQjFfv6_W8TTAc5TUSpM": true,
    "1JmJVnYVBpfIBGsY19diaRJb6tKcsBzHzGE_73HWHU8": true,
    "Ul8hebpzh_Ip-rqID7QYT0uZ9-PxEjXq9sKCWQCkv1s": true,
    "k9TFtjVpnFZigcENav2ADm_Ljd7donAPvpyIk_35Lu8": true,
    "06cEmH8B_pUVUvWMKyBh6dlZdYhejAuxCIlR9lrNPik": true,
    "mpYV15jE_gTFYqMzNtxbnl0UJ7fJFcfMivFGmYZeeL0": true,
    "V1PLguip3xiR_eUhpMg5EKT_XMIFY1Hw9f_uGstCkeM": true,
    "iYGDq1nYMmmwjkv2y1T8Z9D7dop2igg9Obpd0mVhY2o": true,
    "DWB2q3WOjgSvE5ePoSB3BFAtggwv18wRd6fZKBM06o8": true,
    "Lg2Xkw7HyR2vWhc8itro86y2KPGSFNGW910-y857-DY": true,
    "hc7BCU3wXEcBQ62xwHUoHNtgFCKExMquvhuFGbK12Pg": true,
    "Xo_0KqbEapU5E-k0JU0sobuI8n_qdV_yyRTpGV5e5oc": true,
    "6-v67JlFl7PddsOCoUJ9mun8hpVRi88sJ_8xgYC59qk": true,
    "celZ0EaFF8uA8SCawX-aCCCsBFC3oHS4aBx5VFUebdY": true,
    "S1pE081ONvx9Zk5tg0hEtMeBCUov_BuS86fdNvxdIPM": true,
    "W4US7Xz0GJ8W1USkjg9EXVC_1Pl2cJAqEOZxyWtwv9w": true,
    "hwn2NbR8D9P8X2MfOjpS3eCoGWuvOfi5Itrvc8rpfpM": true,
    "4UARr19TZw3_EDpZvf2u-edi7IE37v2JlFzuLXNPLAs": true,
    "d4B11O1BUu25lLPLD4PK5A9jXeC4SuxbPkMxG8pcqvw": true,
    "AkAfTY0VJc9nEjOdOJrXhSqL-Nzd12JkaYXU2tV_TWQ": true,
    "MRnEju27Zdk0si4Orf-UULqqoysR66q85Ld2bYbkCFY": true,
    "R3dzGS_fgT0JJEi1CQWKagjKKTVl1e2MtxWiY3kGekM": true,
    "4r3KRIQw9-2ng2uWo3gmSh3TDYv2ZIROQ9_cE6mD3ww": true,
    "LIAWMTkHgBtU_L3tCdVLGdj00-8RcADqQgPhY82rQDI": true,
    "nN8-3AZBXHX2K5w0FFT4w1NlTATleMenRCRw9QDkXxc": true,
    "5vjAWCkSPluZe57_jqoiY_Mb8gIcWVrfZG_uwjOZBbA": true,
    "Mk-r9TIJGPhV1nlRBl-hoID0WVyZYR8cZJvmSrhcm4s": true,
    "Sc7ij0Q6su_AuTH-movVe9H3pgraX5eKaakQ5EiAuvM": true,
    "0hJFxnSlSaVmcTxX9p-859Yn-WECkJhd7JRzoSJQ5TQ": true,
    "dKMS9J4yP3Hde7CxMT9ttY1qFciyRegJc3JekExbLOY": true
  },
  "errorMessages": {
    "ujyTE9JheqFgHpdAd9JMwI0sqxmptAC5j1FijJuQpi8": "Caller has already voted.",
    "sXOSQgMWnwUpxBkHVfZC5TPPTEsRcbXCmppTOieODTY": "Vote does not exist.",
    "oY2TQlPh2bgtUvu1wNPk5bJV_NR33nmN6SvzFeI6Um4": "Vote does not exist.",
    "-EwySLKtBqLryl1eNyjCQidaza1kDN_WydvSvRZU3mw": "Caller isn't a member of the repo and therefore isn't allowed to vote.",
    "98eTgNsqbX3jtYol6TrHWB51DNORj7b2oZTHDLtoSys": "Vote does not exist."
  }
}

This is different than yours as the votes have concluded and my state.evolve property is set. I'm trying to figure out the differences is how we're getting the and the only real difference is Arconnect. But, with that said, Dan is using Arconnect and gets the old version of the contract. The other thing weird thing is that I always see the new state on the frontend and so does Rahul, but Dan does not.

Regarding the cache, I'd think that if this was a browser cache issue, then I'd be seeing the old state and not the new one.

I have a small frontend app that I'm testing with. If that helps, I give you that as well. I get the "new" state when I run that app.

ppedziwiatr commented 1 year ago

Re. cache - I'm simply curious if removing the cache and evaluating from scratch will produce the same result as mine. I've never got a result with 'evolve' set...(though I've tested only in node.js, but this should not matter - same as setting wallet, etc). The only non-deterministic code in the contract that I've seen so far is the JSON.stringify (which in general should not be used in the contracts - https://github.com/warp-contracts/warp/issues/280) - but in this case it should not affect the result.

But yeah, the validity reports are different, eg. for hwn2NbR8D9P8X2MfOjpS3eCoGWuvOfi5Itrvc8rpfpM - I always get false, where your version has true for some reason.

This is probably why one of the evolve proposals have passed in your version and the evolve field was set.

I'll analyse this further (though we have some other pending tasks right now, so probably later this week), though it would be great if I could somehow reproduce the state with 'evolve' field set.

If you are able to prepare frontend-based MRE that would generate the state with evolve field set - that would be great!

arcj0 commented 1 year ago

I did remove the cache and see the same results as you. So, it appears that the result we're seeing now is the latest version of contract. The only question that remains in my mind is how did several of us get a different result to begin with. It appears that at some point, warp was returning an invalid contract result. I'm going to hammer away at more test scenarios and see if everything looks good.

ppedziwiatr commented 1 year ago

Hey Joe (https://www.youtube.com/watch?v=ZW-LYUHFDGY ;-) ) There's one thing that we've noticed (and fixed) recently - in general the queries for interactions are distributed among main and replica instances of the gateway We've noticed, that there was a 1-2s delay in data replication between the nodes, which could cause such weird issues.

As I've mentioned - this has been fixed, but if you happen to have similar problems in the future - feel to free to open the issue, we're happy to help!

arcj0 commented 1 year ago

Hey ppe, I'm ok to close, but I did want to let you know that I can replicate this behavior. I'm having to clear the indexedDB cache on load of an AFTR Repo though. It looks like Warp isn't updating the state cache.

ppedziwiatr commented 1 year ago

hmm, is such case please create a repo with MRE and we're happy to further analyse this issue!

arcj0 commented 1 year ago

Actually, I think it might be all good. I'm not seeing the indexedDB issue anymore. I'm going to hammer away at it and see if I can break it again.

arcj0 commented 1 year ago

We're good to close. We haven't seen any problems on this with further testing.