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

Refactoring - Remove redundant definition of BuiltinProgram #31429

Conversation

Lichtso
Copy link
Contributor

@Lichtso Lichtso commented May 1, 2023

Problem

Continuation of #31324, this PR aims to unify the remaining two built-in program structures into one. With this, two other changes will become possible:

  • Using the LoadedPrograms cache for the built-in programs as well, including its usage statistics and feature gate logic.
  • Having multiple functions per built-in program and skipping the instruction deserialization and dispatch.

Summary of Changes

  • Replaces BuiltinProgram in the program-runtime with Arc<LoadedProgram> which wraps solana_rbpf::vm::BuiltInProgram.
  • Adds name string to LoadedProgramType::Builtin
  • Registers one function named "entrypoint" in every built-in program.
  • Adjusts the runtimes built-ins to use Arc.
  • Adjusts the tests and benchmarks.

@Lichtso Lichtso force-pushed the cleanup/remove_redundant_builtin_definition branch 7 times, most recently from 0fb43cf to 41a9b11 Compare May 1, 2023 22:24
@Lichtso Lichtso requested a review from pgarg66 May 1, 2023 22:30
@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Merging #31429 (0667122) into master (fdf7bda) will increase coverage by 0.0%.
The diff coverage is 87.7%.

@@           Coverage Diff            @@
##           master   #31429    +/-   ##
========================================
  Coverage    81.4%    81.4%            
========================================
  Files         731      731            
  Lines      208593   208662    +69     
========================================
+ Hits       169849   169955   +106     
+ Misses      38744    38707    -37     

@Lichtso Lichtso force-pushed the cleanup/remove_redundant_builtin_definition branch from 41a9b11 to 0667122 Compare May 2, 2023 17:42
@Lichtso Lichtso merged commit ae75c7c into solana-labs:master May 2, 2023
@Lichtso Lichtso deleted the cleanup/remove_redundant_builtin_definition branch May 2, 2023 21:01
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.

2 participants