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

deploy should emit system ID<>ABI mapping #2349

Closed
holic opened this issue Feb 29, 2024 · 5 comments
Closed

deploy should emit system ID<>ABI mapping #2349

holic opened this issue Feb 29, 2024 · 5 comments

Comments

@holic
Copy link
Member

holic commented Feb 29, 2024

to make it easier to use direct system calls (world.call) across platforms (not dependent on our TS config)

either way we should probably output some language/platform agnostic deploy artifacts that map system solidity files to their system IDs
so its easier to do these calls/mappings

@0xxlegolas
Copy link

Currently, the ABI generated json files has namespaced_functionNames. If we are using direct calls from the clients(non TS) its totally fine, But if we are using either call or callFrom in the clients

  1. We need a abi (without namespace) and the systemId information about the function

It would be great to have this abi information and systemId information for non typescript clients in one place

@holic holic changed the title deploy should emit system ID and ABI mapping deploy should emit system ID<>ABI mapping Mar 11, 2024
@holic
Copy link
Member Author

holic commented Mar 11, 2024

we're now registering all system and world function signatures: #2382

this should let you generate an ABI given a system ID - is this enough?

@qbzzt
Copy link
Contributor

qbzzt commented Mar 11, 2024

IMAO, no. An ABI also needs to include the return values.

@0xxlegolas
Copy link

registering all system and world function signatures

@holic Is this abi generated without namespace ? Also how is this generated, can you give more info.

Moreover, giving the system id and generating abi looks like a heavy lifting in the client.

  • Client should know what system does the function live
  • Client should know what namespace does the system live

End Goal:
Ideally, it would be great if the client is agnostic of whats happening in the smart contract layer except for encoding the functions using abi.

  • Is it possible to use callFrom with namespaced functions instead of systemId. So that the abi is generated with the namespace and it can be used by the clients no matter what call it makes. eg: callFrom(delegator, calldata)

What we have now as temporary solution to use call or callFrom from our clients:

  • We managed to generate a abi file without namespace prefix
  • We have a getter defined in each system to get the systemId
    Here the client needs to know which system the function lives in and gets the systemId and used the abi to generate the callData and sends to callFrom(delegator, systemId, calldata)

So the suggested approach of generating an ABI given a systemId might still present challenges in terms of client ease-of-use.

@holic
Copy link
Member Author

holic commented Mar 21, 2024

closing this in favor of #2491

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

No branches or pull requests

3 participants