Consensys / mythx-developer-support

Support resources and bug reporting for Mythril Tool Developers
3 stars 1 forks source link

API analysis request pending issue #1

Closed s0b0lev closed 6 years ago

s0b0lev commented 6 years ago

Issues:

Long contract bytecode analyse It takes to long to proceed contract bytecode. Reproduce issue section describe required step to reproduce. Looks like it should be some sort of validation to reject invalid contract or refuse contract by timeout.

API endpoint queue While first question still in progress it is not possible to create other requests: {"result":"Queued","uuid":"e531bbdb-0319-4151-9e62-9adcd8f1a0ea"} So as it takes long time for first requests API becomes blocked for further work.

Steps to reproduce

Prepare Input data:

Smart Contract bytecode: https://etherscan.io/address/0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6#code

Bytecode was received via infura API:

https://api.infura.io/v1/jsonrpc/mainnet/eth_getCode?params=["0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6", "latest"]

API communication

Create Analysis report request

curl -X POST \
    https://api.mythril.ai/mythril/v1/analysis \
    -H Authorization: Bearer [API_TOKEN]  \
    -H Content-Type: application/json  \
    -d '{
      "type": "bytecode",
      "contract": "0x6060604052600436106101a85763ffffffff60e060020a600035041663025e7c2781146101ad57806306fdde03146101df578063095ea7b31461026957806318160ddd1461029f5780631acc26bc146102c457806320a0045a146102d95780632185810b146102ec57806323b872dd146102ff57806327e235e3146103275780632e21740514610346578063313ce5671461036557806344e7faa41461038e5780634662299a146103a1578063481c6a75146103b45780635c658165146103c757806366188463146103ec57806367f046881461040e57806370a08231146104215780637d80265514610440578063867904b41461045f5780638d0899301461048157806395d89b4114610494578063a0e67e2b146104a7578063a24835d11461050d578063a9059cbb1461052f578063adcd905b14610551578063af35c6c714610570578063c422293b14610583578063cd9217f714610596578063d73dd623146105a9578063daf4f66e146105cb578063dd62ed3e146105de578063df50afa414610603578063eb6b192f1461061b578063ee8cbc9d1461063a578063fa4d369814610659575b600080fd5b34156101b857600080fd5b6101c36004356106a8565b604051600160a060020a03909116815260200160405180910390f35b34156101ea57600080fd5b6101f26106d0565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561022e578082015183820152602001610216565b50505050905090810190601f16801561025b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027457600080fd5b61028b600160a060020a036004351660243561076e565b604051901515815260200160405180910390f35b34156102aa57600080fd5b6102b2610804565b60405190815260200160405180910390f35b34156102cf57600080fd5b6102d761080a565b005b34156102e457600080fd5b6102b2610845565b34156102f757600080fd5b61028b61084d565b341561030a57600080fd5b61028b600160a060020a0360043581169060243516604435610856565b341561033257600080fd5b6102b2600160a060020a03600435166108ee565b341561035157600080fd5b61028b600160a060020a0360043516610900565b341561037057600080fd5b610378610915565b60405160ff909116815260200160405180910390f35b341561039957600080fd5b6101c361091e565b34156103ac57600080fd5b61028b61092d565b34156103bf57600080fd5b6101c361093b565b34156103d257600080fd5b6102b2600160a060020a036004358116906024351661094a565b34156103f757600080fd5b61028b600160a060020a0360043516602435610967565b341561041957600080fd5b6102b2610a5b565b341561042c57600080fd5b6102b2600160a060020a0360043516610a63565b341561044b57600080fd5b6102d7600160a060020a0360043516610a7e565b341561046a57600080fd5b6102d7600160a060020a0360043516602435610aba565b341561048c57600080fd5b6102b2610bae565b341561049f57600080fd5b6101f2610bb4565b34156104b257600080fd5b6104ba610c1f565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156104f95780820151838201526020016104e1565b505050509050019250505060405180910390f35b341561051857600080fd5b6102d7600160a060020a0360043516602435610c88565b341561053a57600080fd5b61028b600160a060020a0360043516602435610da3565b341561055c57600080fd5b6102d7600160a060020a0360043516610e30565b341561057b57600080fd5b6102d7610ec0565b341561058e57600080fd5b61028b610f16565b34156105a157600080fd5b6101c3610f81565b34156105b457600080fd5b61028b600160a060020a0360043516602435610f96565b34156105d657600080fd5b61028b611034565b34156105e957600080fd5b6102b2600160a060020a0360043581169060243516611055565b341561060e57600080fd5b6102d76004351515611080565b341561062657600080fd5b61028b600160a060020a03600435166110f0565b341561064557600080fd5b6102d7600160a060020a0360043516611105565b341561066457600080fd5b6102d7600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061116995505050505050565b60078054829081106106b657fe5b600091825260209091200154600160a060020a0316905081565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107665780601f1061073b57610100808354040283529160200191610766565b820191906000526020600020905b81548152906001019060200180831161074957829003601f168201915b505050505081565b60003383600b544210158061079e5750600c5474010000000000000000000000000000000000000000900460ff16155b806107e65750600160a060020a0382166000908152600a602052604090205460ff161580156107e65750600160a060020a0381166000908152600a602052604090205460ff16155b15156107f157600080fd5b6107fb858561118d565b95945050505050565b60035481565b600c5433600160a060020a0390811691161461082557600080fd5b600c805474ff000000000000000000000000000000000000000019169055565b635afc396081565b60095460ff1681565b60008383600b54421015806108865750600c5474010000000000000000000000000000000000000000900460ff16155b806108ce5750600160a060020a0382166000908152600a602052604090205460ff161580156108ce5750600160a060020a0381166000908152600a602052604090205460ff16155b15156108d957600080fd5b6108e48686866111f9565b9695505050505050565b60046020526000908152604090205481565b600a6020526000908152604090205460ff1681565b60025460ff1681565b600c54600160a060020a031681565b600954610100900460ff1681565b600654600160a060020a031681565b600560209081526000928352604080842090915290825290205481565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054808311156109c457600160a060020a0333811660009081526005602090815260408083209388168352929052908120556109f5565b6109ce81846112b4565b600160a060020a033381166000908152600560209081526040808320938916835292905220555b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6301e1338081565b600160a060020a031660009081526004602052604090205490565b600c5433600160a060020a03908116911614610a9957600080fd5b600160a060020a03166000908152600a60205260409020805460ff19169055565b600160a060020a03331660009081526008602052604090205460ff161515600114610ae457600080fd5b600954610100900460ff1615610af957600080fd5b610b05600354826112c6565b600355600160a060020a038216600090815260046020526040902054610b2b90826112c6565b600160a060020a0383166000818152600460205260409081902092909255907fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c169083905190815260200160405180910390a2600160a060020a03821660006000805160206117f98339815191528360405190815260200160405180910390a35050565b600b5481565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107665780601f1061073b57610100808354040283529160200191610766565b610c27611741565b6007805480602002602001604051908101604052809291908181526020018280548015610c7d57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c5f575b505050505090505b90565b600160a060020a03331660009081526008602052604090205460ff1680610cc0575081600160a060020a031633600160a060020a0316145b1515610ccb57600080fd5b600160a060020a03821660009081526004602052604090205481901015610cf157600080fd5b610cfd600354826112b4565b600355600160a060020a038216600090815260046020526040902054610d2390826112b4565b600160a060020a03831660008181526004602052604080822093909355916000805160206117f98339815191529084905190815260200160405180910390a381600160a060020a03167f81325e2a6c442af9d36e4ee9697f38d5f4bf0837ade0f6c411c6a40af7c057ee8260405190815260200160405180910390a25050565b60003383600b5442101580610dd35750600c5474010000000000000000000000000000000000000000900460ff16155b80610e1b5750600160a060020a0382166000908152600a602052604090205460ff16158015610e1b5750600160a060020a0381166000908152600a602052604090205460ff16155b1515610e2657600080fd5b6107fb85856112dc565b600160a060020a03331660009081526008602052604090205460ff161515600114610e5a57600080fd5b600160a060020a03811615610e9d576009805475ffffffffffffffffffffffffffffffffffffffff0000191662010000600160a060020a03841602179055610ebd565b6009805475ffffffffffffffffffffffffffffffffffffffff0000191690555b50565b600c5433600160a060020a03908116911614610edb57600080fd5b6009805460ff191660011790557feadb24812ab3c9a55c774958184293ebdb6c7f6a2dbab11f397d80c86feb65d360405160405180910390a1565b600160a060020a03331660009081526008602052604081205460ff161515600114610f4057600080fd5b6009805461ff0019166101001790557f29fe76cc5ca143e91eadf7242fda487fcef09318c1237900f958abe1e2c5beff60405160405180910390a150600190565b600954620100009004600160a060020a031681565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054610fc890836112c6565b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600c5474010000000000000000000000000000000000000000900460ff1681565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600160a060020a03331660009081526008602052604090205460ff1615156001146110aa57600080fd5b6009805460ff19168215151790557fbac956a1816a25b65e25a2449379c8409891b96663ce5f0b3475c196ec4bfa0f81604051901515815260200160405180910390a150565b60086020526000908152604090205460ff1681565b600c5433600160a060020a039081169116148061113a5750600160a060020a03331660009081526008602052604090205460ff165b151561114557600080fd5b600160a060020a03166000908152600a60205260409020805460ff19166001179055565b60065433600160a060020a0390811691161461118457600080fd5b610ebd81611395565b600160a060020a03338116600081815260056020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600954600090819060ff16151561120f57600080fd5b61121a8585856114de565b905061122461163a565b801561122d5750805b156112ac57600954620100009004600160a060020a031663677ba3d386868660405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561129b57600080fd5b5af115156112a857600080fd5b5050505b949350505050565b6000818310156112c057fe5b50900390565b6000828201838110156112d557fe5b9392505050565b600954600090819060ff1615156112f257600080fd5b6112fc8484611663565b905061130661163a565b801561130f5750805b156112d557600954620100009004600160a060020a031663677ba3d333868660405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561137d57600080fd5b5af1151561138a57600080fd5b509195945050505050565b6000805b6007548210156113f8576000600860006007858154811015156113b857fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020805460ff191691151591909117905560019190910190611399565b5060005b82518110156114515760016008600085848151811061141757fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790556001016113fc565b6007838051611464929160200190611753565b507f9465cd279c2de393c5568ae444599e3644e3d1864ca2c05ced8a654df2aea3cb8360405160208082528190810183818151815260200191508051906020019060200280838360005b838110156114c65780820151838201526020016114ae565b505050509050019250505060405180910390a1505050565b6000600160a060020a03831615156114f557600080fd5b600160a060020a0384166000908152600460205260409020548290108015906115455750600160a060020a0380851660009081526005602090815260408083203390941683529290522054829010155b151561155057600080fd5b600160a060020a03831660009081526004602052604090205461157390836112c6565b600160a060020a0380851660009081526004602052604080822093909355908616815220546115a290836112b4565b600160a060020a03808616600090815260046020908152604080832094909455600581528382203390931682529190915220546115df90836112b4565b600160a060020a03808616600081815260056020908152604080832033861684529091529081902093909355908516916000805160206117f98339815191529085905190815260200160405180910390a35060019392505050565b600954600090620100009004600160a060020a0316151561165d57506000610c85565b50600190565b6000600160a060020a038316151561167a57600080fd5b600160a060020a033316600090815260046020526040902054829010156116a057600080fd5b600160a060020a0333166000908152600460205260409020546116c390836112b4565b600160a060020a0333811660009081526004602052604080822093909355908516815220546116f290836112c6565b600160a060020a0380851660008181526004602052604090819020939093559133909116906000805160206117f98339815191529085905190815260200160405180910390a350600192915050565b60206040519081016040526000815290565b8280548282559060005260206000209081019282156117b7579160200282015b828111156117b7578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617825560209290920191600190910190611773565b506117c39291506117c7565b5090565b610c8591905b808211156117c357805473ffffffffffffffffffffffffffffffffffffffff191681556001016117cd5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582050e6734d2e5bb8a18d6b1b029eb056a7d79606d1696897d0ed77f44ce8a8ce600029"
    }'

Checking report status with UUID

curl -X GET \
  https://api.mythril.ai/mythril/v1/analysis/<uuid> \
  -H 'Authorization: Bearer [API_KEY]'

> {"result":"In progress","uuid":"53348172-9040-46ef-aaf4-e10039491a63"}

This status was not changed anymore.

s0b0lev commented 6 years ago

Request still has {"result":"In progress","uuid":"53348172-9040-46ef-aaf4-e10039491a63"}

birdofpreyru commented 6 years ago

@s0b0lev

Many thanks for logging the issue. API is back to normal now.