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

feat(core): add template registration sidechain features #4470

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Aug 15, 2022

Description

  • adds CodeTemplateRegistration output type
  • adds TemplateRegistration to SideChainFeatures
  • add grpc methods for registering a code template

Motivation and Context

Code templates need to be committed to on L1.

The binary_url and repo_url fields are not validated by base node consensus because:

  1. The rust implementation of Multiaddr does not currently support paths in http addresses e.g. /dns4/github.com/tcp/443/http/tari-project/tari.git is not well-formed however the spec says it should be.
  2. Url parsing is complex and adding it to consensus code could introduce bugs (general/security/DoS)

Depends on #4466
Depends on #4496

How Has This Been Tested?

TODO: add cucumber tests for this output type

@sdbondi sdbondi force-pushed the core-template-registration branch 2 times, most recently from f0b19b0 to 9fcf00a Compare August 15, 2022 10:07
@stringhandler stringhandler changed the base branch from development to feature-dan August 16, 2022 11:03
@sdbondi sdbondi force-pushed the core-template-registration branch 2 times, most recently from d4f67b0 to d4c239e Compare August 18, 2022 10:01
@sdbondi sdbondi marked this pull request as ready for review August 18, 2022 10:32
@sdbondi sdbondi force-pushed the core-template-registration branch from 4ff2a5c to c9ae047 Compare August 18, 2022 10:34
Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@sdbondi sdbondi marked this pull request as draft August 22, 2022 06:22
@sdbondi sdbondi marked this pull request as ready for review August 22, 2022 07:00
stringhandler
stringhandler previously approved these changes Aug 29, 2022
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to include a few merges from development

@stringhandler stringhandler merged commit 8ee5a05 into tari-project:feature-dan Aug 29, 2022
@sdbondi sdbondi deleted the core-template-registration branch August 29, 2022 09:56
stringhandler pushed a commit that referenced this pull request Sep 27, 2022
Description
---
* Created a new `lmdb` database for template registrations, with methods for inserting and fetching them.
* Base layer stores in the database all templates that appear in new blocks.
* New gRPC method `GetTemplateRegistrations` to retrieve all new templates since a specific block height

Motivation and Context
---
In [previous work](#4470) we added template registration to UTXO sidechain features.

The next step is for the base layer to store and index all template registrations that appear in blocks, as well as provide a gRPC method to retrieve them.

As the main query for templates will come from the base layer scanner in the Validator Node, the gRPC query method should allow to filter all new templates since a specific block height.

How Has This Been Tested?
---
Manually ran the base layer and perform a gRPC query via Postman.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants