bitcat365 / oasisscan-backend Goto Github PK
View Code? Open in Web Editor NEWoasisscan.com backend
oasisscan.com backend
It seems that the hash of regular ParaTime transactions is computed incorrectly. From looking at this part:
The raw
field contains only the inner transaction body without the signature. And the hash is then computed like this:
But the hash should be computed over the whole signed transaction blob (e.g. over r.getTx()
).
The block hash on oasisscan.com is wrong on both mainnet
and testnet
. Please see below
A correct hash looks like the following
Notice the difference in length. This issue misleads node operators when trying to use state sync.
See oasisprotocol/oasis-core#4384 issue. Thanks.
I made a deposit from a consensus account into an Emerald ParaTime account:
Clicking on the "View transaction records through explorer" redirects to:
https://www.oasisscan.com/paratimes/transactions/031efeabaa315e5c7b4fea4b89585063af63960e8c7a123265e32cd96c761a4e?runtime=000000000000000000000000000000000000000000000000e2eaa99fc008f87f
The Oasis Scan account page:
https://www.oasisscan.com/accounts/detail/oasis1qqk86skatdsuhq8a5qcyt9s8pf37etjrfqsdce5p
It shows the consensus part of the deposit into Emerald:
staking.Allow
txnroothash.ExecutorCommit
txn which shows the event from the chosen consensus account into the Emerald consensus account)However, switching to the Paratime tab in the Transactions panel doesn't show anything for this txn:
Hi, I see something that might be a bug in the API implementation.
Please pardon me if this is the wrong forum to report this; I couldn't find an obvious link on either the OasisScan.com website or in the README of this repo.
See this transaction: https://testnet.oasisscan.com/transactions/5e1b8a01043505741014213a8fd19996eb68621881eb5aceac24f28a5c2820ab
As you can see, this is a burn, and the content is described as:
{
"tx_hash": "5e1b8a01043505741014213a8fd19996eb68621881eb5aceac24f28a5c2820ab",
"method": "staking.Burn",
"fee": {
"gas": 1235
},
"body": {
"amount": "1000000000"
},
"nonce": 0,
"signature": {
"signature": "S0IiWGwa/WgvHxOpoYjhCKfmstx0u5ZHvBHXhRjQSs76MRm47VnOQ+p2FvqZjqUxB1LmPeiffVV7m01sG6mlAw==",
"public_key": "9aBykPfe7o9BWtdjwWmQh0lnaiQmBG/58vhYPROFIDo=",
"address": "oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph"
},
"height": 11753025,
"timestamp": 1663855390,
"time": "2022-09-22T14:03:10Z",
"error": {
"code": 0
},
Notice the amount.
Now if I get this transaction (along with another one), via the API
curl --silent "https://api.oasisscan.com/testnet/chain/transactions?size=20&address=oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph&runtime=true"
Then I get this data:
{
"code" : 0,
"data" : {
"list" : [
{
"add" : true,
"amount" : null,
"fee" : "0",
"from" : "oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph",
"height" : 11753025,
"method" : "staking.Burn",
"shares" : null,
"status" : true,
"time" : 5065,
"timestamp" : 1663855390,
"to" : null,
"txHash" : "5e1b8a01043505741014213a8fd19996eb68621881eb5aceac24f28a5c2820ab"
},
{
"add" : true,
"amount" : "10.00",
"fee" : "0",
"from" : "oasis1qzna6nq9kuktjmxx2s84z38eysqyts84jc9lgdg2",
"height" : 11751888,
"method" : "staking.Transfer",
"shares" : null,
"status" : true,
"time" : 11412,
"timestamp" : 1663849043,
"to" : "oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph",
"txHash" : "2ea41a6b2c8d05d67e73543d0d1045c63fe553901a6dd430af4c6e6d22680588"
}
],
"maxPage" : 1,
"page" : 1,
"size" : 20,
"totalSize" : 2
}
}
Here, from the two returned transaction, we are looking at the first one, the burn.
Please note that both the amount and the fee is returned as null and zero, contrary to what was listed directly on the web site.
Am I missing something here, or is this a bug? Thank you for looking into this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.