stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Drop code that becomes unnecessary after 2.1 transition

Open obycode opened this issue 2 years ago • 3 comments

Now that 2.1 has activated, it should be safe to remove the 2.05 parser and type-checker, after ensuring that the new versions are backwards-compatible for all transactions included before 2.1. Similarly, we can remove all code dealing with ASTRules. These changes will greatly simplify the code.

obycode avatar Apr 14 '23 20:04 obycode

Note from meeting - be sure to consider fuzz testing impact.

obycode avatar Apr 18 '23 15:04 obycode

This would be helpful for Clarinet. The JS SDK compiles the clarity-vm to wasm32-unknown-unknown? to run in Node and web browser. But the parser V1 is way slower than V2. To the point where, when compiled to wasm, it's too slow to be used. So Clarinet forces the minimum epoch to be 2.1 so that it always uses the parser v2, and doesn't suffer from performance issues.

The Clarinet implementation of this forced minimum epoch has some issue (especially https://github.com/hirosystems/clarinet/issues/1833), so at this point Clarinet can:

  • add more complexity to this hack to better handle the forced epoch
  • just wait for the parser v1 to be dropped, and remove complexity

hugoclrd avatar Sep 16 '25 14:09 hugoclrd

ASTRules were removed in https://github.com/stacks-network/stacks-core/pull/6482.

brice-stacks avatar Nov 03 '25 20:11 brice-stacks

In a test to see if the v1 parser can just always be replaced with the v2 parser, 12 blocks failed to validate. Further investigation is required.

  • Failed processing block! block = 027a25cb9b3113cf23ffa70514fd3fbea59ee32718bb61b40b0062f39be40e25, error = InvalidStacksBlock("Block cba309e1da2ea3fc5dbbba97c1a49f2000cd5393d5c829f7373c51e16c330a11 state root mismatch: expected bf8e70ff1cedc810381c8e151634cadfe64e8dea425d61fac4ee76b7029b7738, got 3ee19fad1bf538ed54cfd6067fb7a0da4d5d23174196201a3a8e14c4aca48fa8")
    • Block 30167
  • Failed processing block! block = dd0e9abf0cb4405bc4cd015e2a81f4cd0a0b70f3e7da9e5dfb923bd6902088fb. Unexpected cost. expected = {"runtime": 104973584, "write_len": 50590, "write_cnt": 578, "read_len": 10249760, "read_cnt": 4703}, evaluated = {"runtime": 104973443, "write_len": 50590, "write_cnt": 578, "read_len": 10249760, "read_cnt": 4703}
    • Block 62182
  • Failed processing block! block = f776f4dddf3614fa7b833750a4c222ac247adc7834c5be46d9aa71622f54b3b5. Unexpected cost. expected = {"runtime": 208368359, "write_len": 173746, "write_cnt": 2072, "read_len": 27676289, "read_cnt": 11007}, evaluated = {"runtime": 208387564, "write_len": 174692, "write_cnt": 2073, "read_len": 27676290, "read_cnt": 11008}
    • Block 71329
  • Failed processing block! block = 200848b6e93bf43c3dbe31b7adfc056dec5de1ed4863b999b9c0d6efa6defa18. Unexpected cost. expected = {"runtime": 4116091000, "write_len": 861232, "write_cnt": 203, "read_len": 954558, "read_cnt": 539}, evaluated = {"runtime": 4116094000, "write_len": 861232, "write_cnt": 203, "read_len": 954558, "read_cnt": 539}
    • Block 34286
  • Failed processing block! block = 2c9005c0e4b51d71d633834289da1b71e3b23699c114c008959810a5d27e97fb, error = InvalidStacksBlock("Block 0fa0df9d7bbcf982e67c932ae6e3892593dc2da7e04cf6558b43bc56ecb0b082 state root mismatch: expected 61e3c263ff4b91c2ed0d18dae7279cfaf108155d527ccb0eab5469d61ca89a30, got bd8724b8bbcccd2a08d57781f7bbb16027da3af1e26ce34444dac88dd765e8ce")
    • Block 57859
  • Failed processing block! block = 4d97e353dd6abfedbfe091dc976a9e6e025a0548f5ca4895eaea7afab446ab9a. Unexpected cost. expected = {"runtime": 3725282000, "write_len": 181185, "write_cnt": 111, "read_len": 2155873, "read_cnt": 7650}, evaluated = {"runtime": 3725273000, "write_len": 181185, "write_cnt": 111, "read_len": 2155873, "read_cnt": 7650}
    • Block 27065
  • Failed processing block! block = 59268ec91d4da7df6ea63bfe813bc76e29464b8d4b946412942f40cab181f043. Unexpected cost. expected = {"runtime": 46477341, "write_len": 78956, "write_cnt": 818, "read_len": 5683042, "read_cnt": 5205}, evaluated = {"runtime": 46450761, "write_len": 78956, "write_cnt": 818, "read_len": 5683042, "read_cnt": 5205}
    • Block 62773
  • Failed processing block! block = 7bc983160e000fcb7dcd518bbbc1fc44f2a2dea52d293929ae664c6b3ae0fb1c, error = InvalidStacksBlock("Block 25b266cb86fdf2cc59c167288e241a9290bc141c630a7f05ae8a6c02c7e7b42b state root mismatch: expected 01b39e6b0fbeca996e7a8230cb06145de7339f893f5cfa087eb629c347328892, got 908ef6ad4d927852004efd471404fee93c2c1870cc1a189b0b333e210527a393")
    • Block 57858
  • Failed processing block! block = 86d4a674f2f701c003b6ac5f9369c68e089bbbb91f9d33eae556a36e54b24954. Unexpected cost. expected = {"runtime": 30564074, "write_len": 134110, "write_cnt": 132, "read_len": 6924, "read_cnt": 214}, evaluated = {"runtime": 30564215, "write_len": 134110, "write_cnt": 132, "read_len": 6924, "read_cnt": 214}
    • Block 85741
  • Failed processing block! block = 9b1c62e2a5bc57eb2235ae6cadfc4a4fb3f59701fb1d9a4f6a3bfa1e6df968a5. Unexpected cost. expected = {"runtime": 59246098, "write_len": 64602, "write_cnt": 442, "read_len": 9337366, "read_cnt": 2939}, evaluated = {"runtime": 59246239, "write_len": 64602, "write_cnt": 442, "read_len": 9337366, "read_cnt": 2939}
    • Block 91939
  • Failed processing block! block = af8c467336faa48bc6f92cb76b7c2c2916cb19440f6de7f5f0178a06835cc583, error = InvalidStacksBlock("Block 1471be2695c57db1f566ffbfbfcb45f6e1bb70f2c4305db15f0d2c5a3c36a2cb state root mismatch: expected 170056b78265fcb9f13dcee7490b650ef8c80d0cf9de53ce61e8de71598c7fbc, got 83bafde5410f97631abc9a198961145612b3e5d5b922f432f3d059b149635fa8")
    • Block 30131
  • Failed processing block! block = cc394b3b3e07f5cdcfba1d7983cd38d961f8fff06c31df8af7d05de6bc35c2ad. Unexpected cost. expected = {"runtime": 22583533, "write_len": 41580, "write_cnt": 536, "read_len": 5802246, "read_cnt": 3206}, evaluated = {"runtime": 22583674, "write_len": 41580, "write_cnt": 536, "read_len": 5802246, "read_cnt": 3206}
    • Block 42855

brice-stacks avatar Dec 16 '25 14:12 brice-stacks