-
Notifications
You must be signed in to change notification settings - Fork 673
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
Feat/rpc endpoints to fetch data from key #4997
Conversation
dca20bd
to
6260c16
Compare
…o, add `MARF::get_by_path()` to look up `MARFValue`s by `TrieHash` instead of by `&str` keys, and add the relevant `ClarityBackingStore` implementation to the stackslib's read-only and writeable MARF stores
…arityBackingStore::get_data_from_path`
…key hash, instead of by key
Thanks for the reviews @jcnelson 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@jcnelson I'm actually seeing something weird with the last test I added. If I add a request after this call, or if I add a previous request hitting this code path (such as a request Is it possible that this code path breaks the test runner? |
@hugocaillard Can you push a test case so I can take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placing a hold on this until we get further clarity from @hugocaillard
@jcnelson stacks-core/stackslib/src/net/api/tests/getclaritymetadata.rs Lines 267 to 274 in c9d5295
Which is a copy of the first request (L217). But any request after the last one fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Add two new endpoints:
/v2/clarity_marf_value/:clarity_marf_key
/v2/clarity_metadata/:principal/:contract_name/:clarity_metadata_key
I'm currently working on a Clarinet feature that allows to simulate running (or, said differently, to fork the mainnet state in the simnet data store). This requires the ability to fetch values from marf and metadata keys.
These new endpoints are similar to already existing endpoint (such as
getdatavar
,getmapentry
,getcontractsrc
, etc).Applicable issues
N/A
Additional info (benefits, drawbacks, caveats)
Read more about this feature in the Clarinet issue: hirosystems/clarinet#1503
I confirmed that the 2 new endpoints allow to achieve the desired goal by running a local devnet with these changes and forking the Clarinet simnet state from it.
Checklist
docs/rpc/openapi.yaml
andrpc-endpoints.md
for v2 endpoints,event-dispatcher.md
for new events)