GithubHelp home page GithubHelp logo

Comments (12)

onbjerg avatar onbjerg commented on June 15, 2024 2

Maybe something like

  1. Send tx that encodes forward(script) to voting app (A_v) from staking app (A_s)
  2. A_v calls attachMetadata(keccak(script), voteId) on A_s
    • A_s MAY store the attached metadata for further reference
  3. ✨ Time passes ✨
  4. Iff...
    • Vote fails then A_v MUST call forwardFailed(keccak(script)) on A_s
    • Vote succeeds, then A_v MUST call runScript(script)

In this example, the metadata can be used in the staking app to identify "stake pools" (see the repo in Aragon Labs for a brief explanation of what a stake pool is).

Other possible names for rejectForward

  • reject (too vague)
  • forwardFailed (may be mistaken for forwarding a failed transaction)
  • failedForward

Other possible names for attachMetadata

  • attachScriptIdentifier (less vague)
  • attachIdentifier (vague)

The reason for attachMetadata (as opposed to just identifying scripts solely by keccak(script)) is that identifying e.g. stake pools using only keccak(script) is impossible, since the script for creating a vote is different from voting in a vote.

Open issues

  • What about apps that may not have metadata to attach? These will probably be apps that always only do 1 thing, such as the group app, so it might suffice for these to just attach keccak(script) as metadata.
  • What about gas costs?
  • How do we guard the attachMetadata function to make sure no outsider calls it?
  • If this should work, then how frequently do we call attachMetadata? For example, for this to work, votes must also call back (if the caller is a forwarder contract) with the vote ID, which might be super gas intensive.

from aragon-apps.

onbjerg avatar onbjerg commented on June 15, 2024 1

I think generalizing it with something where forwarders call a standard function (reject? failedForward?) with some standardized data (a unique identifier for the app? or keccak256 of the failed script?) would be beneficial.

from aragon-apps.

izqui avatar izqui commented on June 15, 2024

This has to be a variable of the voting app, but we cannot set it in every vote, as it would allow to execute anything regardless of vote result.

from aragon-apps.

onbjerg avatar onbjerg commented on June 15, 2024

@izqui Can we just put this in the icebox for a moment? We might solve the actual issue another way, the more we've talked about this one the more uneasy I feel adding it

from aragon-apps.

izqui avatar izqui commented on June 15, 2024

Yes, removing it from the code freeze milestone for the moment

from aragon-apps.

sohkai avatar sohkai commented on June 15, 2024

A thought for the future: would it be possible to do this by standardizing a "failure" case in the forwarders? Right now, only the voting app can "fail" forwards (every other app just automatically approves a forward, given correct discovery mechanisms) but there will likely be more apps in the future that will require user interaction for approvals.

We can handle this via an override in the forwarder's interface:

function forward(bytes _actionEvmCallScript) public
function forward(bytes _actionEvmCallScript, failureEvmCallScript) public

from aragon-apps.

onbjerg avatar onbjerg commented on June 15, 2024

@sohkai Yes that was discussed, too, but the issue is that the two callscripts have to produce different outcomes.

Intuitively one would think that just checking if the two callscripts are different would suffice, but they might be different and still produce the same outcome.

Consider for example an attacker that would want to send funds from the Vault to their address. They would create a vote with a callscript that does this on success, but on failure it would transfer to e.g. a simple contract that sends funds it was given to his address.

In this scenario, he would receive funds regardless.

from aragon-apps.

izqui avatar izqui commented on June 15, 2024

Yes, my idea is that this reject callscript could be a state variable of the voting app that gets executed on failure of all votes. This isnt that useful before we can pass parameters/attributes to callscripts (related aragon/aragonOS#166 and aragon/aragonOS#161)

from aragon-apps.

luisivan avatar luisivan commented on June 15, 2024

I love your notation @onbjerg

from aragon-apps.

izqui avatar izqui commented on June 15, 2024

I have a feeling that this might work too. Maybe it could even be generalized as a 'forwarding feedback protocol', in which you can expect a callback with some data after performing a fwd.

Is attachMetadata only called back to when the vote is created?

PS: Dat Latex

from aragon-apps.

onbjerg avatar onbjerg commented on June 15, 2024

@luisivan thanks man

@izqui Well that's sort of an open issue, as I mentioned in an edit:

If this should work, then how frequently do we call attachMetadata? For example, for this to work, the act of voting must also call back (if the caller is a forwarder contract) with the vote ID, which might be super gas intensive.

PS: ye boi

from aragon-apps.

sohkai avatar sohkai commented on June 15, 2024

Closing; this is not directly in scope for an additional improvement on top of the current Voting app or aragonOS forwarding structures, and is generally difficult to configure or avoid abuse.

from aragon-apps.

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.