archethic-foundation / archethic-foundation/archethic-node

Smart Contracts: Workers should not keep the parsed contracts in memory

Open
#1,247 0 comments 0 reactions 0 assignees View on GitHub
enhancements feature question smart contracts
Dominant language
Elixir
Stars
82
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### Is your feature request related to a problem?

There's no point for the workers to keep the contracts in memory. It stays in memory for a long time which is a waste of memory. And, on release upgrade, we need to kill the workers because the contracts are already parsed and the interpreter might have changed.

### Describe the solution you'd like

Worker should parse the contract to prepare the schedulers but the parsed contract should not be kept.
On trigger, we can parse it again.

### Additional context

Maybe the argument about memory is not really valid due to the way process' heap is working?

### Epic

_No response_

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by locating the worker path that parses contracts to prepare schedulers and the trigger path that executes them; confirm the process-heap and interpreter concerns before changing behavior. Done means workers do not retain parsed contracts, while triggered execution reparses the contract and scheduler preparation still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.