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

Internal Server Error for ordinal inscriptions that were spent as miner fees #1841

Closed
grdddj opened this issue Feb 26, 2023 · 23 comments · Fixed by #1971
Closed

Internal Server Error for ordinal inscriptions that were spent as miner fees #1841

grdddj opened this issue Feb 26, 2023 · 23 comments · Fixed by #1971
Assignees
Labels

Comments

@grdddj
Copy link

grdddj commented Feb 26, 2023

Some of the URLs on /inscription endpoint are throwing Internal server error , even though the inscriptions are visible on the /tx endpoint

For example:

or

@veryordinally
Copy link
Collaborator

Observed this as well. The issue is that in ord::subcommand::server::Server::inscription the SatPoint for these inscriptions has an all-0 Txid coming out of the index - which shouldn't happen.

Attached is a complete list of the 126
inscription ids with the issue: inscription-ids-with-0-tx.txt

@veryordinally veryordinally self-assigned this Mar 3, 2023
@quantumcthulhu
Copy link

Observed this as well. The issue is that in ord::subcommand::server::Server::inscription the SatPoint for these inscriptions has an all-0 Txid coming out of the index - which shouldn't happen.

Attached is a complete list of the 126 inscription ids with the issue: inscription-ids-with-0-tx.txt

Two of these satoshis were mine before I accidentally spent them as miner fee. Now they give an "Internal server error"

@veryordinally
Copy link
Collaborator

Hey @cberner, @casey thought this might be a redb issue and we just should just throw it your way without any further analysis🤣

@veryordinally
Copy link
Collaborator

@casey now thinks ALL of them may have been spent as fees. Will follow that route later.

@veryordinally
Copy link
Collaborator

veryordinally commented Mar 3, 2023

@casey seems to be right. This is inscriptions being sent to the coinbase. We do not decode this correctly. Encoding is this in inscription_updater.rs:169

      for flotsam in inscriptions {
        let new_satpoint = SatPoint {
          outpoint: OutPoint::null(),
          offset: self.lost_sats + flotsam.offset - output_value,
        };
        self.update_inscription_location(input_sat_ranges, flotsam, new_satpoint)?;
      }

@cberner
Copy link
Contributor

cberner commented Mar 4, 2023

Cool, so you no longer suspect this is a redb bug?

@veryordinally
Copy link
Collaborator

@cberner Yep, no redb issue.

@veryordinally veryordinally changed the title Internal server error for some inscriptions Internal Server Error for ordinal inscriptions that were spent as miner fees Mar 24, 2023
@bodily11
Copy link

Just commenting here so I can follow along and know when this has been fixed so I can reindex. :)

@gmart7t2
Copy link
Contributor

gmart7t2 commented Mar 25, 2023

@casey seems to be right. This is inscriptions being sent to the coinbase. We do not decode this correctly.

It is worth noting that lots of inscriptions have been spent as fees and tracked successfully. All of the following, for example:

#341 - 85dc48c7097323397366f03a6bfc10d643b68147f64fcfd25b157acd0e38a6fdi0
#346 - 525dc94711d5e76a83ce7dde6b85706d97ada3205b9f5cc53709edbb4ced76cei0
#351 - 5ee59cb5f2b88d1aa1dd7ef0f6263a2682412866e8cdb73275fa013429169623i0
#353 - a250ceb15bf4d788c4916637d99b2a262cc4a4fa41d22c4bdc9d66bf94e407d1i0
#354 - 32ee8f1d1f0f73bbf1d0ba220c659aab5d6f67be0360bd3d3493e5bd2d9b68dci0
#379 - cbae334b8ca086b7bffd62b86c827c407dcb472479bed6f8028b00f8fcab9b33i0
#389 - 589158b8ab1ef8fb1fee5da7cc0777c9214518d92b1d0793e7d07b1a6cea44ffi0
#400 - b2acef469488bf9ba089a57f0f071f367c8a80d398113df26046e42327920832i0
#402 - fc5d2a2f251b62fd907d482f65b054febe42ed60b60703cf4ca9d9b6ef79e17bi0
#403 - 4f5f5690e914be12cb01592b205e7a9e78e2057dcbb7e760a72c380721f5bd86i0
#404 - db2406b3f0e0941319131ac41537a1a50d9cb49b14a099adaaa6e77c14151587i0
#451 - 2d5e0d0b7df59c82549cbb90e743de53e33bac8e64426a319d24c1af9581b96fi0
#454 - f3b724a2b24df394811ab9f4604049591ce1083fe30a2eeb36f403a930fc0ad7i0
#1321 - 8ed2594cecbd43e5673168ff160ba00a6d8953fea7ab6b15a112f3bc94adc2f8i0
#1564 - ebe538e1404b2162de460afee1f7d5b865c7130179f87621bfd929c37c9cc558i0

That is a full list of the sub 2k inscriptions that have been spent as fees as of the time of writing.

#379 is spent as fees on its first hop, on purpose.

@gmart7t2
Copy link
Contributor

gmart7t2 commented Mar 25, 2023

In case it's not clear the issue is that when an inscription is spent as fees only the part that is actually fee contributes to the offset in the coinbase.

The code was ignoring the size of the outputs of the tx that spends the inscription as fees, so the locations of all inscriptions that have ever been spent as fees are wrong.

@veryordinally
Copy link
Collaborator

Casey's initial take was he wanted to set the location like we do on purpose, but what's missing is a small piece of logic when decoding inscriptions to catch this. I haven't looked into this deeply yet, if anyone has a proposal for a sound way to fix this issue that could save some time.

@gmart7t2
Copy link
Contributor

Casey's initial take was he wanted to set the location like we do on purpose, but what's missing is a small piece of logic when decoding inscriptions to catch this.

Are you sure? The code as it stands is setting the incorrect offset into the coinbase. I can't see any reason he would do that on purpose. My PR fixes it.

I haven't looked into this deeply yet, if anyone has a proposal for a sound way to fix this issue that could save some time.

Can you explain what is unsound about allocating the input sats to the outputs before allocating them to the fees? That's what my PR does.

@gmart7t2
Copy link
Contributor

I'll try to explain the problem with the simplest mainnet example I could find.

Take a look at inscription 48ad1f64a9e8332b48f88948b681a886028257bbc6c91dfbe3ac130d6552ea4fi0

Here's its reveal tx: https://mempool.space/tx/48ad1f64a9e8332b48f88948b681a886028257bbc6c91dfbe3ac130d6552ea4f

It gets sent here: https://mempool.space/tx/1cd1332d5c6d7793e46ec2feccd071ae72a3a83869eccc5dc212df06ba8a1211#vin=0

Then it gets spent as a fee, here: https://mempool.space/tx/039339db679633db7e6b61f488bb33f75dd5e71a56f119e93874b44d59fd52d5#vin=1

The tx that spends it as a fee has one input of 500000 sats before the inscription in the inputs, and only has 493703 sats in the outputs so the inscription becomes part of the fee. The output is 6297 sats smaller than the input that comes before the inscription, so the inscription is at offset 6297 in the fee from this tx.

To calculate the offset of the inscription in the coinbase of the block we need to sum:

  • the block reward (625000000)
  • the fees from the txs before ours (99400 + 48990 + 35280 + 22185 + 37026 + 21300 + 22523 + 14280 = 300984)
  • the offset to the inscription in the fee it is in (6297)

That gives an offset in the coinbase of 625000000 + 300984 + 6297 = 625307281

However. What ord does is sums:

  • the block reward (625000000)
  • the fees from the txs before ours (99400 + 48990 + 35280 + 22185 + 37026 + 21300 + 22523 + 14280 = 300984)
  • the inputs before ours in the tx that spends the inscription as a fee (500000)

That gives an offset in the coinbase of 625000000 + 300984 + 500000 = 625800984

That is exactly 625800984 - 625307281 = 493703 sats too high, which is because ord didn't subtract the output values from the input values to get the offset into the fee.

The fix is to subtract the output values from the offset.

Please point out any errors in this reasoning, or any other cause for thinking my fix is incorrect.

@gmart7t2
Copy link
Contributor

gmart7t2 commented Mar 26, 2023

Here's a without-sats index created using the fixed code, up to block 782500 if that helps.

@veryordinally
Copy link
Collaborator

Thanks, @gmart7t2 - this sounds very clear. Agree that your approach sounds right. Will take a look at the PR tomorrow. Thanks!

@rayonx
Copy link
Contributor

rayonx commented Mar 26, 2023

Here's an exhaustive list of what I have scraped over mainnet (so far), a list of tuples of inscription number and inscription ID. Hope it helps.

[
   (6928, "ebfc364d43e6f921bc9aff3831340e1b06f8c813cb6fbb8a6a54aa26a8f80497i0"),
   (7025, "1b63cf1b872851da4bb99bb327ee8bd293687046674d96ba384d6104bbef16f9i0"),
   (7243, "94e8cded8c185ee0c4677cdee3e4883f3301b7e8956dffe69d8738f4ba366659i0"),
   (10435, "fdd300b92dd4cf8dc1ccf6d89257646258bbe01ec4d14a3e527514c536633907i0"),
   (14129, "481f2e7e06f7443f8ab2f4d169f19f45a92ba856e7b861c0187749cdcf5ebe25i0"),
   (20100, "70a3e13a924d13844436577a4b5e85b59ff1deec1cab8f9d27b28e301815748fi0"),
   (20136, "208c238cb2caa3012c9b1836dc8169984759693c8217ed0aa20fd0a93d2ea8ffi0"),
   (22816, "9bdfa9fd465205b05290769eb84fb1892767f4683489433d6857bd2db990f261i0"),
   (23199, "459cb341b0407d041d2bf28b3a947e0312e12fb03b526fd423e3e1fa0825d5aai0"),
   (23944, "952d39aee21725e9245a5c3af7422fde71e52a019def12b9ec9c577b9103c7cai0"),
   (24675, "e22102371114a2dc241cc846180c335501af1a2144b20753b19b6c090c86924fi0"),
   (24821, "dfa7ed771ab0fa8dff92495c70593b150d2f22f2a63b42d939a6afe513e34896i0"),
   (24955, "2f05863ddcdb8d6f0d25ca16b2af892514c278562973c93a97800a56419194cei0"),
   (24956, "e8c9a0864b9ee94bd5b7df24af7c2d5c29c7e3b528eae2fd719c11f61965e7d2i0"),
   (24959, "2e28a210da636239f73524dd0455c760a2f7b36b2e3a8531ce0d61060e27d8dfi0"),
   (24960, "537fbff824ec190f3215d3a8a16811089e2b543bcb7e11b82d99c991a89ccbe0i0"),
   (25737, "8d8c719e490ebe099b43d5a0108ab3c3ca59e5843effab92b9c2a921585d0aa0i0"),
   (29054, "c69a66ac60a36a85c6c5add574f900c0692ac0f23a17c2f95625e4ab9e437efai0"),
   (32093, "4f0ffc91fe5b207866c92f6a07584fe8de87a00c6986247fbb4458e379478f84i0"),
   (32121, "154b5f491bd1d3171848ae64019e6cd850f4b42c7bae3fe2b4907392758942cci0"),
   (33265, "260ff7435732d328ee7345a4eebc87d8f28962fbacbb568d4f8e598eb6574bdbi0"),
   (33288, "e80d1bbad6b8ed20bf216cee1cb28e095403252032e2d576f744f155a8b88ef8i0"),
   (34112, "c2b1cf08c09dd87e6f74f6ed7f3b49539a146fffb11c9a6a481a8f4155306e62i0"),
   (34125, "c435c940c9bfbc0abd90b9f66cf5fba23bf6ee9822f0a30975b6dffbb870b36fi0"),
   (34261, "22b718440c362850b6e3b896fbdcf3e0c6e1a874bc8e1a5478a0ba8b37b062fdi0"),
   (35589, "d883c356ed78ca02a303d171f6e13d2e3f7d5a8d0a5231c0ce96ad479f33d80fi0"),
   (35771, "9f5eb879cc48b775bcb33df5c8f80ba8db953520e94725323341831cfb599492i0"),
   (36310, "81bcde8073449d1c1abb35a3833c58130fe67005989603fabb614e9c971b0d8ei0"),
   (36502, "2affda392b776fdaa30d0393543badaceda608606c30c22db8a653d104ffe241i0"),
   (36515, "2fa9b36fb8501369552bffe7bf9a05f79a8f54292c88c426977b5ae3c5903888i0"),
   (39013, "958ab18e73908ee6ee1aad2f75fc7fc056dcf3f396283da949dbd0a0174c17e2i0"),
   (39078, "2cb34458933cb5a56bddb934dad1ce85dff8862ec52891e854b5cff44905f794i0"),
   (39424, "3e94eda74ef23c72b57f0b23656676f289755a8ea23e68154dbd56c6e637fdd1i0"),
   (40121, "d632ac7beb08ceb8f9c17a4db0780d3e7f9edf7d4bc4d3b1a4ce0fb340b5fb1fi0"),
   (42253, "723335780e84469da9e83f4d1f3c23796472b2a876682d917c6d065506b043c9i0"),
   (42731, "43ecfcaf93f0c060d2b5455699a9e5c809392cf89d27e64665754764cd7124b2i0"),
   (47454, "7cbea5f162daaa64cc8f82edf39bb2f8081be4df95a90a849ec3d17cd5652aefi0"),
   (48144, "ae71813b49ae839e1216020b21c0016558f94539899b370928152ffbc3cae9dfi0"),
   (48302, "b6ad2b77f26d31d3fccae95c0ab813460bf7dcfc6402b078bafee97322891156i0"),
   (48526, "cab7a2300304539b46fe791b14a7558cf0ed1b6bf556912634feff7ea97c30a9i0"),
   (58516, "3bdc2316cd8e1eaf1ddd4bd5f7731e8bef52ab1c63b5eadf3944abf8cde3c52di0"),
   (58549, "b79a0a82803ab797564c4172defe986138684cdc57e6d9089acf7b891665ff44i0"),
   (58651, "222a1f89fb94f54225ef2bdc459b57d7d20e26a68115e66cca7c9453c91942f7i0"),
   (58771, "9d7fa5072cb74cbf93a1b411a2413ff2ef650a5260c70f9a4dd629d017465cd9i0"),
   (60523, "aed3ab3b2ad2b6af82ca4d6771744f7487e25eb6ba3b370d1cec8ef0e36e2da4i0"),
   (64933, "405392b16f6b2a79c5f6818e145cd15970436bb40b6d169cf97d07d802997c7ci0"),
   (67134, "88b6bce5d65161a73bf90649b544b4bc8cea10c7806f49a078e26d92bd1c32d2i0"),
   (68897, "b31208936bd9889a478f45280ca2e05e7ad7225f0141b2d31b926e54f7918c83i0"),
   (68955, "36b5477df4817a97a823d9e4a0190fb36effa4392f68762bf104b7b4e5bbd052i0"),
   (74159, "fcf27f3e63f98addbeb2a251bfc6b37ff7254cda27b703451dc843ca5432fe13i0"),
   (89534, "a586ee2ff38825b324971fe97335983419f1abc8b2ea765078fdb7f815a0d463i0"),
   (89563, "042a64a82d64b5f0e932aaa254a459a1a4ba3e503b11199cee1a38ccbd81a402i0"),
   (89565, "d8ba92c7defbf73a045c5bd139ffd975810be183e4b2d9e0e572b753df0cdb0bi0"),
   (89572, "802a0577c590f9a8728cf702ebf3bc03498e53002a090bee916430b418bbd51di0"),
   (89589, "337f046b739026154d63a45e974e3f9401884d6c7bcf0922483466df65793b41i0"),
   (89591, "4915c847ad5dcca9d007e153c3912fa46db9bf936ff0140ef42980eaf6134547i0"),
   (89610, "17f857fb4cc24b4cee031561d34bd072a8c68b6ff957bd33e01d4c1ec09ebf76i0"),
   (89612, "af55e9f4fd54dd94462451fe3ad7297f451321c4d4f1cda4366334d4af0d0f78i0"),
   (89613, "c83b294704a58c47194518b14b1338d7c8fef2d1168508cfcdb23acfb8995179i0"),
   (89615, "3933f1f2982e5b1c20ae50d3207f25cbbea7f18685351a357a18b6856dc28f7di0"),
   (89617, "cb12e9b2f1a0e8c225531de1beb39edd66f8714743425fabf0872bb1cc3edf7ei0"),
   (89657, "d7c8978211ea4f7d97bb48f666558ccd834d84c0f62c9c7540bf1a353ef120e2i0"),
   (89658, "f3bb5d7b9c0d6a1970f0c7d4aeeea9df516af2f8f2c828ebf91a8c5415055de4i0"),
   (89743, "5c075f7835dcfe09d7be775a80a8a313d85c1e0eab57aa3b920b0ce033871e54i0"),
   (89747, "0c497f62c3d0e4192a35d13d478140a98124a266c934b76276cec999f6e4796ci0"),
   (89759, "b6bad18d2b08574f14d84342f722356ea73c19969bd241259443bbd43369428bi0"),
   (89769, "fbf9c24ac7a4943e6f2d4cf14e5e07c8f45cf46d5b9f3dfa052f4ed271d97ba2i0"),
   (89777, "2d8fef3794c64a19022d467fa2f36fdf68ce6e88d6f9933cfcb41a7a8e5eeab2i0"),
   (89797, "05af9bee984bcc870f4ff9d7deeb8f0a7590b6103a24af78ca7a1a46d13c1fd4i0"),
   (89808, "f643ec243731218882752b972520c7fa55ee07ae71eb2b800a3bfcc573b43bedi0"),
   (89811, "d36bf65c6b97235ba4c817c7bf4d7c49bf76216371692fcd498b6539f8ed60f7i0"),
   (89854, "7cd15e8c360e7015b85e976f2cee8e73649b5d84185a1a6e28fec93e52659a1ai0"),
   (89865, "811cf05d06e667bf135abac59dd09dd4f76417007e0681bc65394ae47a342f4ci0"),
   (89868, "fccc1f0830446e0a58cfccd0e396bbbcbf267d09e0e1a7a22e38d6f49d52a967i0"),
   (89871, "53b33d88f54c00db294fbfcc5befd8f557d7a2f6267f6867511836d92f356f8ei0"),
   (89884, "d535ed1afb72db9a664806f85d8f1f70ea61093decd7d00d1570dc89b3f7e2edi0"),
   (90017, "3947209b06a54c5189edc69345aeeceaaacbc9e88df0448b3320f236ef632b0ai0"),
   (90018, "bc85ede3994879288b195892bf290321dfa27b8cd8edeae430c0fe0d8ab6fa0ai0"),
   (90029, "26f79ebfb93ece5839ac4ec00d5e4d2e4498f6c503699cbe19ce67e2c7278f19i0"),
   (90030, "05457b06ab4a84a0eb83f81147d51ec733c52b64f9a01a043ecd8692b01ee119i0"),
   (90033, "6e24b0f77482c9a556ee1ca716d7493e8a96f3138279c054c3422f96ad65b51ci0"),
   (90037, "aba4605fb40c2600f1e497fdf821907682fc15c8b6c9da3f1e3601602d72f320i0"),
   (90055, "96f971a5dc1e8785ed76dff0d9df9d19ce17d793d97b697cd642f993ad0d9e33i0"),
   (90069, "4658df9026ecbbe00206215b5bd2763bb9fa2e60a7fcf1a1296f1fca5693a943i0"),
   (90075, "c6a8601eb4ecbd299514195710a433ed341b4aa0e9a603527a4f512e65d1c84ei0"),
   (90076, "b43dd9038c12ce6158545aed4fea1cd430e0466127ead5f80d036c2fcd0b3f57i0"),
   (90079, "4c338f5963a515af34fe3bbaf46ac1bc7196922ceee10479ae7439716ae8b15ei0"),
   (90099, "06a970d83ecddbb9898542dae2f14371c2ee548a1cd8a8489a50a6e56b43e783i0"),
   (90102, "5b3abd650d99c0e1ca537d0b2f740cee95d2b1264734827adb40f4f757059285i0"),
   (90110, "44efd64e1b2d8431e1b5b35c4535095d5e2d90bf92e3c1fd2c557f66457ac38ci0"),
   (90126, "04e50598e9ba3decd0e7172ffc0e112509c2825f4f095f27d7340bb07ec262a3i0"),
   (90129, "c79af121113f75034519d9a9cccc902e5b0b01d7776f6d8a2b5326c392c3f0a8i0"),
   (90143, "d216451ac63a8b924729de64c0b11517efa5771daa72c925507997817dd893b8i0"),
   (90150, "74dda170d3ee83ca0a694a3555afa5c0031b5ef8f331d10f115f5439ad33bdbdi0"),
   (90155, "1ffdf35c2acb22a067941f6f6abd35a183dbbec98b6cea6cac92f63d63e32cc8i0"),
   (90161, "fcc6e1c063a6a2079acc16750bc3e8db9b08d7709cb94f86d2e2a4cb9fb28bcci0"),
   (90162, "e9e585e0741fd8a76208bcd544cd99d9824c8ed82dc59a74de597f1225f43acei0"),
   (90327, "7b046590669cb05cf2856f91e3022bbb4afbe6c98737f39d390de5b67213c822i0"),
   (90386, "a3706da5e7b1592f14f17ebfce1ba80ca7a8cce972374896adfc2630e43a334ci0"),
   (90420, "07f4349b29079185c394d76fb05ea7852bc79366961d8d9d8c7a2ca0ac72cc91i0"),
   (90437, "47033845287ce385dad4663d5e13eff8835b98b9eb26bcf27511dcb8991726b0i0"),
   (90440, "738808bcc942505c4615923a6beb8458c8974f801dd5dbd0502e04bf2870c8b8i0"),
   (90448, "95f2a41f62c0a7ce1e7df910c13e762ee3b2d584b2b97b31696e6c4391aa17cci0"),
   (90451, "f67caa69072086d717ef7c0f600d2e14d33325ea18364122ba1cff4af8877ed7i0"),
   (90475, "1aa5a41bd8c719c988e603c4ca5a49705548f9e6fe41fbb4a3452e351be89bf4i0"),
   (90477, "ecd6152049db91a4bcb060de78bf1057ea57db2e284b3f0406d6d39543db71f7i0"),
   (92621, "f7007b5c5bafd69bd26e0a201f7a505602a9a956f8279c76e7c4cedd78f02244i0"),
   (92631, "5ee05d5a091d02bc748a5472f885dea53b853ad3d758eef892be467e698bfc61i0"),
   (92637, "881906c6401de927b3603035abecb9c72b29c6a48fa55263f4ad2ae620ec8982i0"),
   (92639, "54282fd8667e16ba7d661ba32678d7aa8ec69f73736ae44e2ae166e77c0bd286i0"),
   (92647, "14a73e2af6ac00970a4bf94817d56166009a95327b782b9b1a7749e5a3d474aei0"),
   (92650, "eb49a03aaaa7b1d57053beb574f7977a74439934c8819ea83a2c163f0359e5bfi0"),
   (117816, "c2c7f7d956172eb0629861fb09f53730a9a448cb2ae2182b79d37ea4165b64d3i0"),
   (118603, "4ec1c02d3b258f80bd5f633fd9d59cfa089a36e261cdfbf5c5c5fda49d2f4f98i0"),
   (121203, "3e08157d2c7f41a15734865723558c395c00be5d90c8c767ed3c195824085310i0"),
   (121206, "c97490a515b4dbff451b8052a336a8e2633fa2d5d45deeafcb0f2ef5915b6e85i0"),
   (122872, "6bffbc7c9fc518c4041cb1b9a265c986cf2f72fafdd2012ae55698cd9fb01944i0"),
   (129699, "3be84fb3e773a0fc136c1eecfc6f438dd94e5aca2edf65e17d185e4c1a4ae471i0"),
   (139791, "8ae4f4b93d8e3bb4b53b8dd437d8d360930f0e9733f437d67d465daf2a57fdabi0"),
   (139839, "97e4fbe87d50eb3852b7814d470633926f735edf556a761c46b584e9617868d0i0"),
   (143608, "a67f8109d970accb89448a7c1f63a4e5af62e4c29581dfdcdf9afa8fc2f31a63i0"),
   (144234, "a31b8e3e279a6e28ef49fa4dca54f820abf266223976b778833e8c47991ad403i0"),
   (144288, "3d85ca419f50b1128f8954fe98147742f83baf0206ee3db54e386b81cb61739di0"),
   (146634, "fb9e5bc7326e94f4a2ad2289f3b72d75cb1efc96eadb6f1279d9e516c8f6105ei0"),
   (146641, "d903e75fef52d877f81c494353189cdf013688f135ff01582b3eb15a9d7081afi0"),
   (146643, "eca096499eb5311bb153f9a00b7b0dd32b929ea887b7c9ed6e80c15db122b7c9i0"),
   (146646, "73b3dd71078d217254797b6ecc7cc384486c0fa7248a9cd8fc52345520da64d1i0"),
   (153909, "29384ededa7bb9261ed771bed80f0feaa88192465a7237112113ea69db3f7a98i0"),
   (169919, "cea28ef341570aa4d15fcac7c84955a82d974a29355e8d4316804b46a87638cai0"),
   (172080, "3fd000d33039745b70539399c395b2a013f08fd256ef542a1b76fc9acee8de73i0"),
   (173127, "f9a277900108f2e4abca7d7c2dd3fa3cf327a8b66a5f533236703fed9c1768d2i0"),
   (196946, "bf4800adf210b1f89c012a7239df4128400076214c3a9627a000194332bd6bb4i0"),
   (205462, "3ebbe47c6c33c64c62b772494a7ff2ca865ba05adfc83f4b652a0c6713e6d01ci0"),
   (208437, "768efb435300b39ca9436df33b45756ad90d557b0fab15284cbe5b500f3e74b7i0"),
   (216901, "2f3f3ac69c7a29b8e185433eebad0ffe430478f63dda65e5dd5757271765f085i0"),
   (218607, "739ca5722560d6bfa9541c2b87c085cc55c5a9d6243c070dd91865483c54fa77i0"),
   (219217, "62700fe8a9b99ab12630f55569a46250537a69067782d4068a7f8676233dd600i0"),
   (227311, "d8305a8e939aa7689c7689b835d758962a93956c5ff5755f88db19f0cb0a3ea8i0"),
   (227806, "1845bb6a4240a5e56e9b66d8cf0959cbfc485e3f274a1d5bff857a4bf7409fd1i0"),
   (236048, "61ffe692ba215a2db7d8e09940c6be7b8cee30986ccf6d923da61c134f2027cbi0"),
   (241030, "d94331d912458f3708b3cda19bbb4b793a72c6e471d0d9f3c4a52e85e4487852i0"),
   (241033, "a76b5782bec8884fe6bbb7a0694949a3d662a1e012b14d7098a7a039e112395ai0"),
   (241258, "e7104cb89b66679e1b0f084aeb5b3d6a8218c2048183abfdb1155fd8a49594e0i0"),
   (242291, "5b7b2afe72ffbf3d061fbf4bb7c9117c9966fdaeab6a3a8221c7edf035b5ec96i0"),
   (242322, "052c8b132444a5c2d4d6a6227813b6d3b23a7e8ea9094049157ed6369ef4a2edi0"),
   (251673, "f51bb228b4ddac03b08853b89a51e39b20e7d273838fe2c9a034e55260736cc1i0"),
   (251675, "da8d0449d62c652971dcd86a5f9cc4fb2dd6ec27117306d71135138e7f182a04i0"),
   (251816, "3c7ca8335931ab790db5083c221a1536ac2d30d6c5653510498460d6b8289b4ci0"),
   (253505, "f31857bd6ddab28b5f44816b13159b5c41e20b792cf5b3052d1304c11b28e47bi0"),
   (253694, "59609c9923db0011599ed5d0034df899174b2ce7bf6e02dfbb678d7ce2ecb987i0"),
   (253890, "2244d7d4f432bff5dcc123008527a702b84884a62d1213c0cc5fc16de16c064di0"),
   (253892, "141bbb618a17a590ad598686c33c03276255fa6cea75b95ce0317067fe8e2193i0"),
   (253894, "fb9e849dd095fc4a7c7f24f5194176edd3000f44c9b6f35d7acde60a90c05db9i0"),
   (253913, "2ae3c3e50c8fc979fb27e5f8af03bc8a70bb1d19521b9f1bc428a66c42b01061i0"),
   (253914, "583e90d5eca534b35a72d13d15dbc3ce276ccc78a8d44015a408a45b02764010i0"),
   (253916, "c09b36fb0acf8a5da94e8ab258b567e9f2428c938d090d194a9d8fce95a1d33fi0"),
   (253917, "ab9940951b66c3278ff8d2fcb5bb3f7617104c1dae5ec7c10635e0d2a5c31943i0"),
   (253920, "496a91a0fbd178c8cc741358815a75c093d7c4c98f4b1be51182fa90b5782377i0"),
   (253930, "e48adcb6dc63e298348305f16ae15d058de5a4c123bd3f2b9a80217bb6c9edfei0"),
   (253935, "c370a8a3f657d766b0909a7e4fec20ddd01ceb2bd394dd2bd04f8a3ecba3f804i0"),
   (253946, "aab1ed7b785ad7ba9832261769cf5ad7b7448daf0ca995479748833008521b2ei0"),
   (254536, "d9cc2856b7a6f91658eb72ae67fc8c6a521b474dc4ff5927ea415c7578ff3a0ai0"),
   (254538, "4146d58182cb79a8b485f94b34d198eb7feb2849f85df6f7ef9dddef3eabe713i0"),
   (254539, "0efde65ea7c1d7df48626a011a0de96404bd414b9ea6660bc0e32445a2dfc314i0"),
   (254540, "fa8b5c187c7a615a6abe77ad5124cccf0499e932718b3ded9cbfe1a5240a1618i0"),
   (254541, "c419868d64ac778216a19a9b29e9a4bcfa7d077c3384ef4a3b0d8aa4293da62bi0"),
   (254542, "0bf2ca8bcba3358abe8bf053f37e814fe3209f848eb042ab9b28ce51b4688b46i0"),
   (254544, "3281af6258b733aca6a8c093491dc1fdb1f830f451e1c3506775f6b611f4cb7bi0"),
   (254554, "728ebf4049b9d1cef48885264171c433b5532b1259dd052819665a8bf77a96b5i0"),
   (254555, "f54ba25cec782d7aee759d1d38b2b9f27eefaeb8fd366c2e123cd9525a21b5e5i0"),
   (254659, "8fc6c4707a8cba384f81669db704590503e563d6bf7ee7878035e0f5f21ac428i0"),
   (254660, "008006c41b0111860ebbb92c42bfa2e791da0a6ab5a88b63659ccfef01af5431i0"),
   (254661, "859a433d38bc20f45fdf7e34c66ad6403a490f126da92a4d152ad38552e0b337i0"),
   (254663, "7c2c31ee2255a85ade0c123fa9d705cefcbd1adf67f686d519ab3924ed9ef642i0"),
   (254666, "0b593f5b9d4766bfd08ef465cfd482e5ab05e8f3ea323ee28ac5e22f148833a7i0"),
   (254673, "ed2397f84f781a3870b7eddf3c9c50f1f6b71e31dd388bcbd49cca309a3a4307i0"),
   (254677, "98ac18a05d9c5cd763fc0c4bee766113a260512f8f7b943c8f714b90bb31b75di0"),
   (254678, "c7ab3ceb2524e4db24b4695fef9c45d54e723c0e6929eebdde7f463bb8c1df67i0"),
   (254682, "2568da1efff35cff3a2a4d21a2c25fbd14ca446b06265b5b1bbbffe119d87eb1i0"),
   (267868, "8374df7d0ef37ad63afd477e23f1ae9b0075ead5dacb7b4e0f3b77c912bde977i0"),
   (282324, "c6b6e18b382b27e8031d6bf796efc58bc0b2b92a23bb09abf7e61f4b218015d5i0"),
   (282325, "7f66a5cd86ccab62f567a7ee18bce660469a6aa3ae8823167911317a8ca96600i0"),
   (282328, "d7d17fe1da06492b6317a8075a0cebbdfda2e4aff435cd003d3b64f18709fe72i0"),
   (282331, "86f391060fa5c60439e5d1537c0b717fb4b0088b1ca92bd061f86135e280cceai0"),
   (282343, "c1720047cff34f18dfb57d6f0ef943ac2cd370b3c280402530a7587541232289i0"),
   (282344, "52f21e5e4903285df34f18eb72458108e32864e373bf963279a5bec6c3c91790i0"),
   (291695, "0a0a15daac19466057fb1fb1e1749386e2f2fc9864c0839eed4302c4393f361di0"),
   (302637, "f5b094e1646981aa474645dad871ce058f4f5ddcf41847100d31ca314cd37408i0"),
   (302731, "181f744be9331cd95ab2ff415f62252e317a4e4350813ebe773854c449716f94i0"),
   (306623, "279da03a854107efd981b2de08484030158c6a6822651a584c39295f4a53a0f5i0"),
   (310746, "e2fd284d9d7af706ac9222ae8572a812ddea3f6f76857638c1a309f66aabd0eei0"),
   (321351, "e71cc4c67240c70d14d1e65e5fb129fd8a6a340ff3c4eb637345844d09915150i0"),
   (339491, "5a50f74c4668306d6ca1f62a1c79fccd9793bf8e948380037563adb40ee81858i0"),
   (339507, "fbc6cb5064376541fa3bfdc0766858ba83366b8f8ad27e017dd0cdd7991a7091i0"),
   (350948, "41f0a93ea676938e1dce4a1f8ad12cd6c4d0eec4fe4f2917b0af17ef825e5f03i0"),
   (359830, "4958a767d4795e07cae7c37799db6583e53c3ce11d6f3b1dff6eb80ae084698fi0"),
   (360152, "7e78b7f34c127b4fd28b812c61afbbe7f23daffa43fbc9c313a4dfd2ea6bb237i0"),
   (376808, "41c757453aac47ec9e68e9cb61742ba5154655a427d85e10f2f7acf44d96a975i0"),
   (376809, "188af83d499dd1623c697db34f7f049d16901db27b3ecb2e3a86154b54e85b7fi0"),
   (377969, "0f5050596fedc2b7bb71b6a5837442d361e34aeb70cf2d62e7c946d7a77ccb0di0"),
   (377972, "0bcdfcd4966a6251214c0197968c5ae711b3e2743e12a930bdc34f99623dc733i0"),
   (377973, "68ed6b914e5a4a5621132ca992c1f883d9303035b6f90f45e7c989afb35cdc33i0"),
   (377975, "dcb17ff8b06d52654f59e41615ceb3ff53c17901e683aa71c67d48d33b9d8037i0"),
   (377980, "cd49139865d130b9e54f4d235a84b3b491a41e44e24293c286ce007dd48d8b94i0"),
   (377988, "b1cc7813d3173a953963ec239cf08ae98651e0c934deca08b0caf7f114ca7fd8i0"),
   (378336, "390133893b9ef4abf3772250dc6d22b08f3294f06ded4e4e910e21327c202314i0"),
   (378351, "06ad1280b663d0e5a3ed03eb71b34e8735a5bdb553e4fa5902ec935c1260a623i0"),
   (378392, "db04c4e38c5f9b53ea0f416822335355cbf59686364220ea42b119ec00418845i0"),
   (378432, "2494a667f0de2cdca8d4b131718f0f4b8c630882b6e292d05b030e4ca14daa70i0"),
   (378446, "dc3ebdb53c316b5ee1ed9fd62c944bd9a719becd5aeb305c706c991795171e85i0"),
   (378448, "f22bba79e4ba39651fb59b516fc6a504b122b43152d4b2f6a3856051f3a2f687i0"),
   (378481, "ed8388a81d836e5a8e9335cc0167e21a8e607969ed6055c7729236edf93e12aei0"),
   (378520, "8bb23b4e8191032368f921a9b44b4c655a3f3936b6856c11c2c9ffa9e27abde1i0"),
   (381224, "79e63d4fd4f98d239394443798cabf6482821b94042fd299233ff93acb83bf63i0"),
   (415479, "1d08ab0486eb5f29eab97ab007d30d6cbb0f7867a7b7bf01556248bd3a3d2749i0"),
   (445382, "f9c35026e73fb2e588da97b39bbd260f57c4a1edc69d8bef9ebffead24bc67a1i0"),
   (490548, "f3089b594f7a7664dacb24d58a3838ea4c80740b21be8adcd271c7c5d893130ei0"),
]


@gmart7t2
Copy link
Contributor

Here's an exhaustive list of what I have scraped over mainnet (so far), a list of tuples of inscription number and inscription ID. Hope it helps.

That's almost exactly the same as my list except it's missing #41259 and #55588.

Also that is just a list of the inscriptions whose locations are so wrong they are off the end of the block reward. There are another 946 inscriptions that are still viewable on the explorer but which have their location shown incorrectly.

I won't list them here, but for example:

Inscription #504856, 006d8ae06f8faa31b174ebd8aca253030573df3354197d2cb9eee57f7d3ca593i0 is shown as being at a150fc4b0b14acc6296f8d973f11e8e5fc1ade2cfcfa6d2a3889fb1ea1f1ac0a:15:6006 when in reality it is at e43a013d2b4aad6b0aa115704ff64d286b89d398ff246f12a4cfef876043b3c1:0:16469022164.

@unisky
Copy link

unisky commented Mar 27, 2023

https://github.com/casey/ord/blob/master/src/index/updater/inscription_updater.rs

there is a bug in code line 181.

flotsam.offset is absolute offset in transaction. but the offset we need should be offset in fee.

So this code line may should change to

old code:
offset: self.reward + flotsam.offset

new code:
offset: self.reward + flotsam.offset - output_value

I will submit a pull request to fix this later

image

@nammaki
Copy link

nammaki commented Mar 27, 2023

Is this issue related to the bug that @casey wrote about in https://github.com/casey/ord/issues/1455#issuecomment-1435049264 or is that a different bug?

@gmart7t2
Copy link
Contributor

Is this issue related to the bug that @casey wrote about in #1455 (comment) or is that a different bug?

No. That is about a different bug:

#1455 is about ord failing to detect the creation of some old inscriptions

This issue is about ord failing to accurately track the location of existing inscriptions when they are sent as fees

@nammaki
Copy link

nammaki commented Mar 27, 2023

Is this issue related to the bug that @casey wrote about in #1455 (comment) or is that a different bug?

No. That is about a different bug:

#1455 is about ord failing to detect the creation of some old inscriptions

This issue is about ord failing to accurately track the location of existing inscriptions when they are sent as fees

Thanks for the insight, maybe you could provide some info in https://github.com/casey/ord/issues/1455 since @casey prioritized it to be fixed but there doesn't seem to be any details or an inscription list ❤️

@gmart7t2
Copy link
Contributor

maybe you could provide some info in #1455 since @casey prioritized it to be fixed but there doesn't seem to be any details or an inscription list ❤️

All I know is what @casey tweeted:

"There was a bug that hid some inscriptions around 500-600".

I don't know if the bug was ever reported anywhere or ever fixed. If I had to guess I would say the bug was in the code that created those inscriptions rather than in the indexing code. But I don't have to guess. So I won't.

@gmart7t2
Copy link
Contributor

Here's a without-sats index created using the fixed code, up to block 782500 if that helps.

And here's a with-sats index created using the fixed code, up to block 782500 too.

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

Successfully merging a pull request may close this issue.

9 participants