Comments (9)
Hey @Retamogordo , what @fuadop did here is to set the fee at the default from mainnet. Which will give the same fee calculation for 0 bytes.
On mainnet, after a couple of bytes, the fees are completely dynamic, based on many factors that we cannot recreate on arlocal since there's no competition while mining, limits of txs per blocks, etc.
Hope this helps answer why it's different. The fee should be calculated from the arlocal endpoint /price/:bytes
.
from arlocal.
Sure !, A PR has been raised on #127. I'll be sure to notify you when npm gets updated with this change.
from arlocal.
Hey @Retamogordo 👋
This is currently outdated, the latest arlocal version uses calculation based on https://arweavefees.com
from arlocal.
Hi, thanks.
I'm still confused. This code is still there, I can see it on the latest version of transactions.ts.
And another thing (possibly not related to the former one) is that price requests return different values depending on what provider is queried, e.g.:
https://arweave.dev/price/400 => returns 65595508 (plain format)
http://localhost:1984/price/400 => returns 26238203 (json)
from arlocal.
At first glance (I forked the repo today):
in app.ts:
quering price uses this:
this.router.get('/price/:bytes/:addy?', async (ctx) => (ctx.body = (+ctx.params.bytes / 1000) * 65595508));
while post transaction code uses another formula to check if balance is sufficient:
async function txPostRoute(ctx: Router.RouterContext) { .... const calculatedReward = +(data.data_size || '0') * 1965132; if (!wallet || wallet.balance < calculatedReward) { ctx.status = 410; ctx.body = { code: 410, msg: "You don't have enough tokens" }; return; }
So my tx fails due to insufficient balance, despite I airdrop winston according to price query.
}
from arlocal.
I see @Retamogordo
This is a bug! Thank you very much for noticing this. A fix would be made for this soon!🙏
from arlocal.
Ouch..
So could you somehow inform me as soon as it is fixed ? I mean when it is ready for install at npm.
Thanks a lot.
from arlocal.
Hi, it's me again,
I see that the fix is merged, so query results must be consistent.
There is one thing I still do not catch, though.
On https://arweavefees.com/ I notice that they use a kind of step function for fee calculations,
namely I get the same results for data sizes of, let us say: 400 bytes and 1000 bytes or 4000 bytes, which is 64958659 winston.
Contrary to that ArLocal uses a linear function on data size for fee calc, so for 400 bytes I get 28402855 winston.
So I still observe a certain inconsistency of the two approaches.
from arlocal.
Cool, thank you.
from arlocal.
Related Issues (20)
- block timestamp format
- Running `npx arlocal` returns error `SubtleCrypto not available!` HOT 16
- GQL returns posted transactions without mining the block - with block set to null HOT 4
- Support for partial content requests HOT 2
- upgrading arweave-js to version >= 1.10.24 results with a TypeError
- POST /tx 410 HOT 7
- POST /tx 413 HOT 6
- Binary Bundle TX uploaded via chunks not being un-bundled
- Bundled Data-Item Transactions don't need chunkDB entries
- GraphQL returns incorrect block height for block queries when there are over 100 blocks HOT 2
- Blocks without transactions return array with empty string inside HOT 2
- TypeError: ArLocal is not a constructor HOT 2
- Feature request: ArBundle support HOT 2
- Post transaction returning 410 Error when token balance is greater than transaction fee HOT 2
- Validation Error for last_tx field needs corrections?
- Add support for in-memory sqlite db and/or DataDB HOT 1
- Problems after last release. 404 Not found errors
- Wallet not found error HOT 3
- Balance is 0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arlocal.