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

165 transaction content max size #227

Merged

Conversation

blackode
Copy link
Contributor

@blackode blackode commented Feb 17, 2022

Description

In this change, we are keeping the threshold limit for the size of the content in the data field of the transaction. This means we are not allowing the content size to be greater than the configured threshold limit.

Add validation functions for the changesest TransactionPayload and TransactionData structs.

A new config line was added as follows

config :archethic, :transaction_data_content_max_size, 3_145_728

Fixes #165

Type of change

  • New feature (setting up the max-content size )

How Has This Been Tested?

Creating the content size greater than content_max_size using the LOC

Base.encode16(:crypto.strong_rand_bytes(4 * 1024 * 1024))

and trying to create a changeset of the transaction payload.

  • Test API should return an error if the content size is greater than the content_max_size
  • Test Mining should return an error if the content size is greater than the content_max_size

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

config/config.exs Outdated Show resolved Hide resolved
@blackode blackode changed the title 165 transaction content max size WIP: 165 transaction content max size Feb 17, 2022
@blackode blackode changed the title WIP: 165 transaction content max size 165 transaction content max size Feb 17, 2022
@ghost ghost merged commit 47e35b7 into archethic-foundation:master Feb 17, 2022
@ghost ghost mentioned this pull request May 13, 2022
This pull request was closed.
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.

[Feature]: Set the maximum size of the transaction's content
1 participant