Coder Social home page Coder Social logo

Comments (7)

dincho avatar dincho commented on May 23, 2024 1

I have to admit that the concept of preflight allures me - what is the purpose or why do we need it...

Google says: GET , POST , and HEAD are considered simple requests (and are case-sensitive). They do not require preflight. 🤔

It's CORS stuff of course :)

from aeternity.

hanssv avatar hanssv commented on May 23, 2024

I have to admit that the concept of preflight allures me - what is the purpose or why do we need it...

Google says: GET , POST , and HEAD are considered simple requests (and are case-sensitive). They do not require preflight. 🤔

from aeternity.

dincho avatar dincho commented on May 23, 2024

I definitely disagree here.

First of all while the dry-run doesn't mutate the node state itself, because ... well .. it's a dry run - it is actually a mutable operation on the node state, just the new state is thrown away.

Abusing GET requests with blob data also never ended well.

I've always been proponent of the idea of separate and specific API operation for "static calls" and disabling the dry-run "in production".

from aeternity.

davidyuk avatar davidyuk commented on May 23, 2024

it is actually a mutable operation on the node state, just the new state is thrown away

The same for get requests in general, server allocates some RAM to compute the result (changes its state 🙃), and disposes it after that.

Abusing GET requests with blob data also never ended well.

Regarding limitations, I find out that our Cloudfront setup limits URLs to 1-2k chars. I won't propose to change that. It is still anough to call a contract providing like 3 addresses.

separate and specific API operation for "static calls"

Sounds also good to me, it may accept contract address, encoded calldata and return the call result.

from aeternity.

hanssv avatar hanssv commented on May 23, 2024

I'm curious, what is a 'static call' and how is it different from a dry-run? (Isn't a gas limit the best/only way to limit resource usage in a relevant way?) Also, why would it fit better in a HTTP GET? The component of a contract call that can be largest is the calldata?

from aeternity.

davidyuk avatar davidyuk commented on May 23, 2024

I'm curious, what is a 'static call' and how is it different from a dry-run?

Dry-run executes a transaction. We name 'static call' when a contract method gets executed using dry-run. Do you think better to name it dry-run as well? For example in js sdk:

-myContract.sum(1, 2, { callStatic: true })
+myContract.sum(1, 2, { dryRun: true })

Isn't a gas limit the best/only way to limit resource usage in a relevant way?

'static call' endpoint can be the same way limited by gas 👍

Also, why would it fit better in a HTTP GET?

It also can be GET and POST. GET for lighter requests (without CORS, better for polling), POST when calldata is big.

The component of a contract call that can be largest is the calldata?

I think so.

from aeternity.

hanssv avatar hanssv commented on May 23, 2024

But?! If dry-run and static call is the same thing, then this makes no sense:

I've always been proponent of the idea of separate and specific API operation for "static calls" and disabling the dry-run "in production".

from aeternity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.