К вопросу реализации алгоритма консенсуса Raft на основе механизма корутин и специализированной сетевой библиотеки
Аннотация
В данной статье рассматривается реализация модуля консенсуса Raft Server на языке программирования C++ стандарта 20. Ключевой особенностью работы является то, что алгоритм реализован без использования сторонних библиотек. Такой подход гарантирует гибкость и дает возможность сделать упор на обеспечение максимальной производительности. Вначале представлен обзор алгоритма Raft, затем подробно изложен процесс разработки Raft Server, а также представлено описание собственной сетевой библиотеки, основанной на механизме корутин. Реализация алгоритма использует возможности C++ стандарта 20, в частности корутины, для представления эффективной и современной методологии создания критических компонентов распределённых систем. В данном исследовании не только демонстрируется практическое применение и преимущества корутин C++20 в сложных распределённых программных средах, но и проводится анализ возникающих проблем и их решений при разработке модуля консенсуса, такого как Raft Server.
Литература
2. Bahrepour D., Maleki R. Benefit and limitation of using blockchain in smart cities to improve citizen services. GeoJournal. 2024;89:57. https://doi.org/10.1007/s10708-024-11040-7
3. Ongaro D., Ousterhout J. In search of an understandable consensus algorithm. In: Proceedings of the 2014 USENIX conference on USENIX Annual Technical Conference (USENIX ATC'14). USA: USENIX Association; 2014. p. 305-319. Available at: https://web.stanford.edu/~ouster/cgi-bin/papers/raft-atc14.pdf (accessed 12.05.2024).
4. Rodrigues L.A., Freitas A.E.S., Duarte Jr. E.P., Fulber-Garcia V. A Hierarchical Adaptive Leader Election Algorithm for Crash-Recovery Distributed Systems. In: Proceedings of the 13th Latin-American Symposium on Dependable and Secure Computing (LADC '24). New York, NY, USA: Association for Computing Machinery; 2024. p. 136-145. https://doi.org/10.1145/3697090.3697102
5. Lu S., Zhang X., Zhao R., Chen L., Li J., Yang G. P-Raft: An Efficient and Robust Consensus Mechanism for Consortium Blockchains. Electronics. 2023;12(10):2271. https://doi.org/10.3390/electronics12102271
6. Albshaier L., Budokhi A., Aljughaiman A. A Review of Security Issues When Integrating IoT With Cloud Computing and Blockchain. IEEE Access. 2024;12:109560-109595. https://doi.org/10.1109/ACCESS.2024.3435845
7. Sati A., Al-Tabtabai H. A paradigm shift toward the application of blockchain in enhancing quality information management. Construction Innovation: Information Process Management. 2024;24(1):407-424. https://doi.org/10.1108/CI-05-2023-0099
8. Dinh T.T.A., Liu R., Zhang M., Chen G., Ooi B.C., Wang J. Untangling Blockchain: A Data Processing View of Blockchain Systems. IEEE Transactions on Knowledge and Data Engineering. 2018;30(7):1366-1385. https://doi.org/10.1109/TKDE.2017.2781227
9. Asiamah E.A., Keelson E., Agbemenu A.S., Tchao E.T., Adjaidoo T.-S., Klogo G.S. Optimizing Blockchain Querying: A Comprehensive Review of Techniques, Challenges, and Future Directions. IEEE Access. 2024;12:196282-196305. https://doi.org/10.1109/ACCESS.2024.3522584
10. Bogdanov A., Shchegoleva N., Khvatov V., Kiyamov J., Dik A. Combining PBFT and Raft for Scalable and Fault-Tolerant Distributed Consensus. Physics of Particles and Nuclei. 2024;55(3):418-420. https://doi.org/10.1134/S1063779624030225
11. Zhang P., Zhou M. Security and Trust in Blockchains: Architecture, Key Technologies, and Open Issues. IEEE Transactions on Computational Social Systems. 2020;7(3):790-801. https://doi.org/10.1109/TCSS.2020.2990103
12. Xu R., Chen Y., Blasch E., Chen G. Microchain: A Hybrid Consensus Mechanism for Lightweight Distributed Ledger for IoT. arXiv:1909.10948. 2019. https://doi.org/10.48550/arXiv.1909.10948
13. Kogias M., Bugnion E. HovercRaft: achieving scalability and fault-tolerance for microsecond-scale datacenter services. In: Proceedings of the Fifteenth European Conference on Computer Systems (EuroSys '20). New York, NY, USA: Association for Computing Machinery; 2020. Article number: 25. https://doi.org/10.1145/3342195.3387545
14. Dujak D., Sajter D. Blockchain Applications in Supply Chain. In: Kawa A., Maryniak A. (eds.) SMART Supply Network. EcoProduction. Springer, Cham; 2019. p. 21-26. https://doi.org/10.1007/978-3-319-91668-2_2
15. Reda M., Kanga D.B., Fatima T., Azouazi M. Blockchain in health supply chain management: State of art challenges and opportunities. Procedia Computer Science. 2020;175:706-709. https://doi.org/10.1016/j.procs.2020.07.104
16. Noergaard T. Chapter 6 Board I/O. In: Embedded Systems Architecture (Second Edition): A Comprehensive Guide for Engineers and Programmers. Amsterdam: Elsevier Science; 2018. p. 261-293. https://doi.org/10.1016/B978-0-12-382196-6.00006-6
17. Tavares B., Correia F.F., Restivo A. A survey on blockchain technologies and research. Journal of Information Assurance and Security. 2019;14:118-128.
18. Moosavi N., Taherdoost H., Mohamed N., Madanchian M., Farhaoui Y., Khan I.U. Blockchain Technology, Structure, and Applications: A Survey. Procedia Computer Science. 2024;237:645-658. https://doi.org/10.1016/j.procs.2024.05.150
19. Wang R., Zhang L., Xu Q., Zhou H. K-Bucket Based Raft-Like Consensus Algorithm for Permissioned Blockchain. In: 2019 IEEE 25th International Conference on Parallel and Distributed Systems (ICPADS). Tianjin, China: IEEE Press; 2019. p. 996-999. https://doi.org/10.1109/ICPADS47876.2019.00152
20. Gu R., Huang D. A Leadership Transfer Algorithm for the Raft. In: Sun Y., Cai L., Wang W., Song X., Lu Z. (eds.) Blockchain Technology and Application. CBCC 2022. Communications in Computer and Information Science. Vol. 1736. Singapore: Springer; 2022. p. 13-30. https://doi.org/10.1007/978-981-19-8877-6_2
21. Du Z., Qu Z., Fu Y., Huang M., Liu L. Multi‐strategy‐based leader election mechanism for the Raft algorithm. Concurrency and Computation: Practice and Experience. 2023;35(22):e7734. https://doi.org/10.1002/cpe.7734
22. Wu Y., Wu Y., Liu Y., Shi T. The research of the optimized solutions to Raft consensus algorithm based on a weighted PageRank algorithm. In: 2022 Asia Conference on Algorithms, Computing and Machine Learning (CACML). Hangzhou, China: IEEE Press; 2022. p. 784-789. https://doi.org/10.1109/CACML55074.2022.00135
23. Zhang P., Tao Y., Zhao Q., Zhou M. A Rate-and-Trust-Based Node Selection Model for Block Transmission in Blockchain Networks. IEEE Internet of Things Journal. 2023;10(2):1605-1616. https://doi.org/10.1109/JIOT.2022.3210197
24. Zhang P., Schmidt D.C., White J., Dubey A. Chapter Seven-Consensus mechanisms and information security technologies. Advances in Computers. 2019;115:181-209. https://doi.org/10.1016/bs.adcom.2019.05.001
25. Auhl Z., Chilamkurti N., Alhadad R., Heyne W. A Comparative Study of Consensus Mechanisms in Blockchain for IoT Networks. Electronics. 2022;11(17):2694. https://doi.org/10.3390/electronics11172694

Это произведение доступно по лицензии Creative Commons «Attribution» («Атрибуция») 4.0 Всемирная.
Редакционная политика журнала основывается на традиционных этических принципах российской научной периодики и строится с учетом этических норм работы редакторов и издателей, закрепленных в Кодексе поведения и руководящих принципах наилучшей практики для редактора журнала (Code of Conduct and Best Practice Guidelines for Journal Editors) и Кодексе поведения для издателя журнала (Code of Conduct for Journal Publishers), разработанных Комитетом по публикационной этике - Committee on Publication Ethics (COPE). В процессе издательской деятельности редколлегия журнала руководствуется международными правилами охраны авторского права, нормами действующего законодательства РФ, международными издательскими стандартами и обязательной ссылке на первоисточник.
Журнал позволяет авторам сохранять авторское право без ограничений. Журнал позволяет авторам сохранить права на публикацию без ограничений.
Издательская политика в области авторского права и архивирования определяются «зеленым цветом» в базе данных SHERPA/RoMEO.
Все статьи распространяются на условиях лицензии Creative Commons «Attribution» («Атрибуция») 4.0 Всемирная, которая позволяет другим использовать, распространять, дополнять эту работу с обязательной ссылкой на оригинальную работу и публикацию в этом журналe.
