dashpay / platform

L2 solution for seriously fast decentralized applications for the Dash network
https://dashplatform.readme.io/docs/introduction-what-is-dash-platform
MIT License
70 stars 40 forks source link

Document Creation Error: Proof of State Transition Execution Mismatch #2169

Open LexxXell opened 1 week ago

LexxXell commented 1 week ago

Document Creation Error: Proof of State Transition Execution Mismatch

Expected Behavior

Creating a document should execute without errors and generate a proof of state transition that matches the expected document structure.

Current Behavior

The document is created successfully, but an error occurs during the proof validation step. The error message is:

called Result::unwrap() on an Err value: Drive(Proof(IncorrectProof("proof of state transition execution did not contain expected document (time fields were not checked) after create with id Bk26VPXUUzacSj6xu8QEdVYdN76RPYjM8isBhS3PLW3o")))

It seems that the proof of state transition execution does not contain the expected document after creation.

Possible Solution

The issue might be related to the validation of time fields in the proof of state transition. It could be worth checking the proof generation logic and how time fields are handled during document creation.

Steps to Reproduce (for bugs)

  1. Clone the repository from dash-sdk-test.
  2. Set up and start Dashmate with the provided configuration (see dashmate config below).
  3. Run the code from the repository.
  4. Observe the error message during proof validation.

Context

This issue affects the validation of created documents. I'm trying to ensure that the document creation and proof validation processes work as expected without errors.

Your Environment

Additional Data

Dashmate Config

Testnet configuration:

{
  "description": "node with testnet configuration",
  "group": null,
  "docker": {
    "network": { "subnet": "172.25.24.0/24" },
    "baseImage": {
      "build": {
        "enabled": false,
        "context": "/usr",
        "dockerFile": "/usr/Dockerfile",
        "target": ""
      }
    }
  },
  "core": {
    "insight": {
      "enabled": false,
      "ui": { "enabled": false, "docker": { "image": "dashpay/insight:latest" } },
      "docker": { "image": "dashpay/insight-api:latest" },
      "port": 3001
    },
    "docker": { "image": "dashpay/dashd:21", "commandArgs": [] },
    "p2p": { "host": "0.0.0.0", "port": 19999, "seeds": [] },
    "rpc": {
      "host": "127.0.0.1",
      "port": 19998,
      "users": {
        "dashmate": {
          "password": "C2irAHGTaiuh",
          "whitelist": null,
          "lowPriority": false
        },
        "dapi": {
          "password": "PHzDUjks04Xw",
          "whitelist": [
            "getbestblockhash",
            "getblockhash",
            "sendrawtransaction",
            "getrawtransaction",
            "getblockstats",
            "getmerkleblocks",
            "getrawtransactionmulti",
            "getrawmempool",
            "getblockcount",
            "getbestchainlock",
            "getblock",
            "getblockheader",
            "getblockheaders",
            "protxdiff",
            "getnetworkinfo",
            "getblockchaininfo",
            "mnsyncstatus",
            "masternodestatus"
          ],
          "lowPriority": true
        },
        "drive_consensus": {
          "password": "FF4z6CuMW1P5",
          "whitelist": [
            "getbestchainlock",
            "getblockchaininfo",
            "getrawtransaction",
            "submitchainlock",
            "verifychainlock",
            "protxlistdiff",
            "quorumlistextended",
            "quoruminfo",
            "getassetunlockstatuses",
            "sendrawtransaction",
            "mnsyncstatus",
            "getblockheader",
            "getblockhash"
          ],
          "lowPriority": false
        },
        "drive_check_tx": {
          "password": "mldogo07Zwa6",
          "whitelist": [ "getrawtransaction" ],
          "lowPriority": true
        },
        "tenderdash": {
          "password": "us7nPkB2I2gn",
          "whitelist": [
            "quoruminfo",
            "quorumverify",
            "quorumplatformsign",
            "masternodestatus",
            "masternodelist",
            "ping",
            "getnetworkinfo"
          ],
          "lowPriority": false
        }
      },
      "allowIps": [ "127.0.0.1", "172.16.0.0/12", "192.168.0.0/16" ]
    },
    "spork": { "address": "yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55", "privateKey": null },
    "masternode": { "enable": false, "operator": { "privateKey": null } },
    "miner": {
      "enable": false,
      "interval": "2.5m",
      "mediantime": null,
      "address": null
    },
    "devnet": {
      "name": null,
      "minimumDifficultyBlocks": 0,
      "powTargetSpacing": 150,
      "llmq": {
        "chainLocks": "llmq_devnet",
        "instantSend": "llmq_devnet_dip0024",
        "platform": "llmq_devnet_platform",
        "mnhf": "llmq_devnet"
      }
    },
    "log": {
      "filePath": null,
      "debug": {
        "enabled": false,
        "ips": false,
        "sourceLocations": false,
        "threadNames": false,
        "timeMicros": false,
        "includeOnly": [],
        "exclude": []
      }
    },
    "indexes": []
  },
  "platform": {
    "gateway": {
      "docker": { "image": "dashpay/envoy:1.30.2-impr.1" },
      "maxConnections": 1000,
      "maxHeapSizeInBytes": 125000000,
      "upstreams": {
        "driveGrpc": { "maxRequests": 100 },
        "dapiApi": { "maxRequests": 100 },
        "dapiCoreStreams": { "maxRequests": 100 },
        "dapiJsonRpc": { "maxRequests": 100 }
      },
      "metrics": { "enabled": false, "host": "127.0.0.1", "port": 9090 },
      "admin": { "enabled": false, "host": "127.0.0.1", "port": 9901 },
      "listeners": {
        "dapiAndDrive": {
          "http2": { "maxConcurrentStreams": 10 },
          "waitForStResultTimeout": "125s",
          "host": "0.0.0.0",
          "port": 1443
        }
      },
      "log": {
        "level": "info",
        "accessLogs": [ { "type": "stdout", "format": "text", "template": null } ]
      },
      "rateLimiter": {
        "docker": { "image": "envoyproxy/ratelimit:3fcc3609" },
        "metrics": {
          "enabled": false,
          "docker": { "image": "prom/statsd-exporter:v0.26.1" },
          "host": "127.0.0.1",
          "port": 9102
        },
        "unit": "minute",
        "requestsPerUnit": 150,
        "blacklist": [],
        "whitelist": [],
        "enabled": true
      },
      "ssl": {
        "enabled": true,
        "provider": "self-signed",
        "providerConfigs": { "zerossl": { "apiKey": null, "id": null } }
      }
    },
    "dapi": {
      "api": {
        "docker": {
          "image": "dashpay/dapi:1",
          "deploy": { "replicas": 1 },
          "build": {
            "enabled": false,
            "context": "/usr",
            "dockerFile": "/usr/Dockerfile",
            "target": "dapi"
          }
        },
        "waitForStResultTimeout": 120000
      }
    },
    "drive": {
      "abci": {
        "docker": {
          "image": "dashpay/drive:1",
          "build": {

 "enabled": false,
            "context": "/usr",
            "dockerFile": "/usr/Dockerfile",
            "target": "drive-abci"
          }
        },
        "logs": {
          "stdout": {
            "destination": "stdout",
            "level": "info",
            "format": "compact",
            "color": true
          }
        },
        "tokioConsole": {
          "enabled": false,
          "host": "127.0.0.1",
          "port": 6669,
          "retention": 180
        },
        "validatorSet": {
          "quorum": {
            "llmqType": 6,
            "dkgInterval": 24,
            "activeSigners": 24,
            "rotation": false
          }
        },
        "chainLock": {
          "quorum": {
            "llmqType": 1,
            "dkgInterval": 24,
            "activeSigners": 24,
            "rotation": false
          }
        },
        "instantLock": {
          "quorum": {
            "llmqType": 5,
            "dkgInterval": 288,
            "activeSigners": 32,
            "rotation": true
          }
        },
        "metrics": { "enabled": false, "host": "127.0.0.1", "port": 29090 },
        "grovedbVisualizer": { "enabled": false, "host": "127.0.0.1", "port": 8083 },
        "epochTime": 3600,
        "proposer": { "txProcessingTimeLimit": 5000 }
      },
      "tenderdash": {
        "mode": "full",
        "docker": { "image": "dashpay/tenderdash:1.3" },
        "p2p": {
          "host": "0.0.0.0",
          "port": 36656,
          "persistentPeers": [],
          "seeds": [
            {
              "id": "74907790a03b51ac062c8a1453dafd72a08668a3",
              "host": "35.166.35.250",
              "port": 36656
            },
            {
              "id": "2006632eb20e670923d13d4f53abc24468eaad4d",
              "host": "35.92.64.72",
              "port": 36656
            }
          ],
          "flushThrottleTimeout": "100ms",
          "maxPacketMsgPayloadSize": 10240,
          "sendRate": 5120000,
          "recvRate": 5120000,
          "maxConnections": 64,
          "maxOutgoingConnections": 30
        },
        "rpc": {
          "host": "127.0.0.1",
          "port": 36657,
          "maxOpenConnections": 900,
          "timeoutBroadcastTx": "1s"
        },
        "pprof": { "enabled": false, "port": 36060 },
        "metrics": { "enabled": false, "host": "127.0.0.1", "port": 36660 },
        "mempool": {
          "cacheSize": 15000,
          "size": 5000,
          "maxTxsBytes": 1073741824,
          "timeoutCheckTx": "3s",
          "txEnqueueTimeout": "30ms",
          "txSendRateLimit": 100,
          "txRecvRateLimit": 120,
          "maxConcurrentCheckTx": 250,
          "ttlDuration": "24h",
          "ttlNumBlocks": 0
        },
        "consensus": {
          "createEmptyBlocks": true,
          "createEmptyBlocksInterval": "3m",
          "peer": {
            "gossipSleepDuration": "100ms",
            "queryMaj23SleepDuration": "2s"
          },
          "unsafeOverride": {
            "propose": { "timeout": null, "delta": null },
            "vote": { "timeout": null, "delta": null },
            "commit": { "timeout": null, "bypass": null }
          }
        },
        "log": { "level": "info", "format": "plain", "path": null },
        "node": {
          "id": "ec41b1385747fdc2c33a4d0d4f050c510c846a12",
          "key": "NJcZzgkK1rjrQeqlKwmUqgejVo66fpzhULZJyy/O65AATqpL7+nMZNXVqcrCaLwgt0/4zspmaRwQgP2rqCpREw=="
        },
        "genesis": {
          "consensus_params": {
            "block": {
              "max_bytes": "2097152",
              "max_gas": "57631392000",
              "time_iota_ms": "5000"
            },
            "evidence": {
              "max_age": "100000",
              "max_age_num_blocks": "100000",
              "max_age_duration": "172800000000000"
            },
            "validator": { "pub_key_types": [ "bls12381" ] },
            "version": { "app_version": "1" },
            "timeout": {
              "propose": "50000000000",
              "propose_delta": "5000000000",
              "vote": "10000000000",
              "vote_delta": "1000000000"
            },
            "synchrony": { "message_delay": "70000000000", "precision": "1000000000" },
            "abci": { "recheck_tx": true }
          },
          "chain_id": "dash-testnet-51",
          "validator_quorum_type": 6
        },
        "moniker": null
      }
    },
    "sourcePath": null,
    "enable": true
  },
  "dashmate": {
    "helper": {
      "docker": {
        "build": {
          "enabled": false,
          "context": "/usr",
          "dockerFile": "/usr/Dockerfile",
          "target": "dashmate-helper"
        }
      },
      "api": { "enable": false, "port": 9100 }
    }
  },
  "externalIp": "176.123.3.18",
  "network": "testnet",
  "environment": "production"
}