Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ANN] Dev Status Update(mainnet) #35

Open
andelf opened this issue Oct 27, 2020 · 11 comments
Open

[ANN] Dev Status Update(mainnet) #35

andelf opened this issue Oct 27, 2020 · 11 comments

Comments

@andelf
Copy link
Owner

andelf commented Oct 27, 2020

Update 2020/10/27

Stopped at 4152605.

Problem: balance mismatch

Update 2020/10/29

The balance mismatch located.

Account: TLw48YQsUcKTkuPnn9nHjieacvntHADQaw

block #4137160 0xa33ca08a8cffff532fa43771527e145a63a37fca50dd1468632acc146e8e2d7a

An ExchangeTransaction

in opentron:

exchange sell #1000161:29218, buy #0:13516579895

while in javatron:

buy #0:13516579896

See-also: https://stackoverflow.com/questions/64586096/math-pow-in-java8-and-java13-returns-different-result

Update 2020/10/30

Recorded as #36. Fixed.

@andelf andelf pinned this issue Oct 29, 2020
@andelf
Copy link
Owner Author

andelf commented Oct 29, 2020

Update 2020/10/30

Stopped at block 4191802.

Balance mismatch for TJbjRBAKKhNEAHMEqjxRFA6KPBrVLuFtuf

Update 2020/11/01

Re-sync:

opentron
#4146014 0a5296a4e01fae39eb73527bf09d6f05f45a8985f55dbbe1e4b7e2c0128c0878
balance=72178577494 energy_used=0 energy_slot=514130674

javatron
#4146014 0a5296a4e01fae39eb73527bf09d6f05f45a8985f55dbbe1e4b7e2c0128c0878
balance=72178577494 energy_used=0 energy_slot=514130674

Re-sync fixes. 😅

@andelf
Copy link
Owner Author

andelf commented Nov 1, 2020

Update 2020/11/01

Stop at: 0xa58995a7160be51ec2388f749c8abe1468c0cac795a8e879f912837882e0d490 at block #4194116

thread 'main' panicked at 'protobuf decode error: DecodeError { description: "invalid wire type: LengthDelimited (expected Varint)", stack: [("CreateSmartContract", "call_token_id")] }', opentron/src/manager/executor/mod.rs:683:76
Field #4: 22 String Length = 2, Hex = 02, UTF8 = "''"

invalid surfix = 22022727
curl --request POST \
  --url https://api.trongrid.io/wallet/gettransactionbyid \
  --header 'Content-Type: application/json' \
  --data '{"value":"a58995a7160be51ec2388f749c8abe1468c0cac795a8e879f912837882e0d490","visible":true}'

Recorded as #38. Fixed.

@andelf
Copy link
Owner Author

andelf commented Nov 1, 2020

Update 2020/11/01

Stop at: 0x2293f1ec646c9c3bfc16aa9ad7867c702e14ba51bd82f4f5e8b09478bddf6754 at block #4255300

transfer from TXV5W1KHc4mAEUtReRycTwMW6Yaf1pZZsi to TVrNGFNUDvpqTiy1XJo1HAadSZ26YZvYMD with amount 1286559529

insufficient balance

Balance matches at 4192109.

Related to burnt energy consumption.

Recorded as #39.

Update 2020/11/04

Rewrite the energy consumption code. let's see.

Fixed.

@andelf
Copy link
Owner Author

andelf commented Nov 4, 2020

Update 2020/11/04

Stop at: 0xf6451b5238ad77c8024912343ea92267af247fb55fed03a02a21adfb801efee1 at block #4282748

Recorded as #41.

Fixed by rewrite validation logic of TriggerSmartContract.

@andelf
Copy link
Owner Author

andelf commented Nov 4, 2020

Update 2020/11/04

Stop at: 0x8fdcc480c8bd869ec91dc515cb8c3d72aa0e49ade4452b9cc614c8a0a78a1260 at block #4452583

TVM contract result mismatch.

Inconsistency in handling ORIGIN opcode. ORIGIN before multisig returns 21 bytes

Recorded as #42, fixed.

@andelf
Copy link
Owner Author

andelf commented Nov 4, 2020

Update 2020/11/04

Stop at: 0x096a71541d3549230595b858a794abc41c89bffd035c79b16dd2933dc723b77f at block #4621946

TVM contract result mismatch.

Update 2020/11/05

Bug located, error while handling UnfreezeBalanceContract at block 4621702.

Located, recorded as #44, fixed.

@andelf
Copy link
Owner Author

andelf commented Nov 6, 2020

Update 2020/11/06

Resync from genesis. sync speed=22block/s, the average txn process time is 0.2ms. (6core12threads, 32G)

NOTE: javatron's average txn process time is 5+ms for a typical cloud server.

@andelf
Copy link
Owner Author

andelf commented Nov 6, 2020

Update 2020/11/06

Stop at: 0xe2be4dadd9c71e0b98716ec7b99f20ea2c657229df6688ed0f2e30af86c3c7b0 at block #4686682

A Smart Contract call.

TVM exit reason mismatch. required=Unknown, opentron=Revert.

The energy calculation is OK before this.

A call to address(0x0) with value and data. All checks passed. Haven't figured out why.

# javatron

"resMessage": "validateForSmartContract failure"

# opentron

! CALLing 0x0000000000000000000000000000000000000000 input=36 depth=None static=false transfer=50000000

Also to mention that, the account 0x0000000000000000000000000000000000000000, i.e. T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb is created at 5c7d1fd483b4facdcbcc8d6a7d833db59851b41b4274164d43b3112efb582ad9, block 3900143.

Update 2020/11/07

The contract is a revert-attack contract to a dice game. But the game contract is inited with address(0x0).

Update 2020/11/18

Resync and add massive debug code.

The problem is: Calling an empty contract with no value transfer bypasses validateForSmartContract.

Recorded as #45, Fixed.

@andelf
Copy link
Owner Author

andelf commented Jan 14, 2021

Update 2021/01/15

Just had some busy days.

Resume developing.

@andelf
Copy link
Owner Author

andelf commented Jan 16, 2021

Update 2021/01/16

  • Update dependencies, resolve compile errors
    • rocksdb 6.14.6, same version as brew
  • Now opentron should compile on all os

@andelf
Copy link
Owner Author

andelf commented Jan 17, 2021

Update 2021/01/18

  • Update to tokio 1.0
  • Refactor old graceful shutdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant